mch2022-template-app/main/main.c

39 lines
833 B
C
Raw Normal View History

2022-06-02 23:30:50 +00:00
2022-06-08 14:24:28 +00:00
// This file contains a simple hello world app which you can base you own apps on.
2022-05-30 21:56:23 +00:00
2022-06-08 14:24:28 +00:00
#include "main.h"
#include "hardware.h"
#include "pax_gfx.h"
#include "pax_codecs.h"
#include "ili9341.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "esp_system.h"
2022-05-16 21:07:30 +00:00
static pax_buf_t pax_buffer;
2022-06-08 14:24:28 +00:00
xQueueHandle buttonQueue;
2022-06-08 14:24:28 +00:00
static const char *TAG = "mch2022-demo-app";
2022-06-08 14:24:28 +00:00
void disp_flush() {
ili9341_write(get_ili9341(), pax_buffer.buf);
2022-06-06 02:01:49 +00:00
}
2022-06-08 14:24:28 +00:00
void app_main() {
// Init HW.
bsp_init();
bsp_rp2040_init();
buttonQueue = get_rp2040()->queue;
2022-06-08 14:24:28 +00:00
// Init GFX.
pax_buf_init(&pax_buffer, NULL, 320, 240, PAX_BUF_16_565RGB);
2022-06-05 23:07:58 +00:00
2022-06-08 14:24:28 +00:00
// Show some hello world.
pax_background(&pax_buffer, 0xffff00ff);
2022-06-08 14:24:28 +00:00
disp_flush();
2022-06-08 14:24:28 +00:00
// Just wait.
while (1) vTaskDelay(10000);
}