new structure

This commit is contained in:
matthias wagner committed 2023-08-01 10:36:51 +02:00
1 parent 56f130a34b
commit 28a24a1274
12 files changed
+7 -10

No files matched your search

View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
+3 -10
View File
@@ -43,21 +43,14 @@ int main()
sleep_ms(100);
tft_start_pixels(lcd_config.pio, lcd_config.sm);
while (true){
for(size_t i = 0; i < 8; i++) {
tft_start_pixels(lcd_config.pio, lcd_config.sm);
tft_fill(0);
dma_channel_wait_for_finish_blocking(dma_chan);
}
sleep_ms(1000);
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
sleep_ms(1000);
}
return 0;
}
+4
View File
@@ -60,6 +60,8 @@ void tft_init(const struct tft_config* config, int dma_channel) {
gpio_put(tft_cfg.gpio_bl, 1);
}
void tft_fill(uint16_t color) {
for(size_t i = 0; i < 8; i++) {
dma_channel_wait_for_finish_blocking(dma_chan);
uint32_t color_left = ((uint32_t)color) << 16;
uint32_t two = 0;
two |= color_left;
@@ -70,3 +72,5 @@ void tft_fill(uint16_t color) {
}
dma_channel_set_read_addr(dma_chan, pix_buf, true);
}
}
View File
File renamed without changes.
View File
File renamed without changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.