diff --git a/.vscode/settings.json b/.vscode/settings.json index 62d4392..d54ae3e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,5 +19,5 @@ "cmake.buildBeforeRun": true, "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", "C_Cpp.errorSquiggles": "disabled", - "cortex-debug.variableUseNaturalFormat": false + "cortex-debug.variableUseNaturalFormat": true } \ No newline at end of file diff --git a/src/main.c b/src/main.c index b98541c..54f15db 100644 --- a/src/main.c +++ b/src/main.c @@ -47,10 +47,17 @@ int main() tft_fill(0); dma_channel_wait_for_finish_blocking(dma_chan); } + tft_start_pixels(lcd_config.pio, lcd_config.sm); + absolute_time_t start = get_absolute_time(); for(size_t i = 0; i < 8; i++) { tft_fill(31807); dma_channel_wait_for_finish_blocking(dma_chan); } + absolute_time_t end = get_absolute_time(); + volatile int64_t diff = absolute_time_diff_us(start, end); + tft_fill(31807); + dma_channel_wait_for_finish_blocking(dma_chan); + // actual refresh rate ~25hz } return 0; } diff --git a/src/tft.pio b/src/tft.pio index c9e7df1..f0f457e 100644 --- a/src/tft.pio +++ b/src/tft.pio @@ -41,7 +41,7 @@ static inline void tft_program_init(PIO pio, uint sm, uint offset, uint data_pin // Making use of the narrow store replication behaviour on RP2040 to get the // data left-justified (as we are using shift-to-left to get MSB-first serial) -// => command gets sent 4 times +// => command gets sent 4 times if out shift is set to 32 static inline void tft_put(PIO pio, uint sm, uint8_t x) { while (pio_sm_is_tx_fifo_full(pio, sm))