new structure
This commit is contained in:
1 parent
56f130a34b
commit
28a24a1274
12 files changed
+7
-10
No files matched your search
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
+3
-10
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
Whitespace-only changes.
Whitespace-only changes.
Reference in new issue
Block a user