use timer

text_rendering
Eggert Jung 2 years ago
parent 2699d85193
commit 22a02d1d66

@ -59,7 +59,7 @@ void display_init(){
gpio_set_level(GPIO_OE, 0);
}
void display_cycle(){
void display_cycle(void* arg){
static uint8_t line = 0;
for(uint8_t i=0;i<128;i++){

@ -31,6 +31,6 @@ void write_address(uint8_t addr);
void latch(void);
void clock(void);
void display_init(void);
void display_cycle(void);
void display_cycle(void* arg);
#endif

@ -11,9 +11,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include "driver/gpio.h"
#include "esp_timer.h"
#include "display.h"
#include "text.h"
@ -26,14 +24,23 @@
#define CHIP_NAME "ESP32-S2 Beta"
#endif
const esp_timer_create_args_t periodic_timer_args = {
.callback = &display_cycle,
/* name is optional, but may help identify the timer when debugging */
.name = "display"
};
void app_main(void)
{
printf("Hello world!\n");
display_init();
esp_timer_handle_t periodic_timer;
ESP_ERROR_CHECK(esp_timer_create(&periodic_timer_args, &periodic_timer));
ESP_ERROR_CHECK(esp_timer_start_periodic(periodic_timer, 500));
put_line(fb, 2, "429 Amalienplatz", 1, 1);
for (;;) {
display_cycle();
vTaskDelay(1);
}
}

Loading…
Cancel
Save