measured tft refresh rate see main() for results
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -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
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user