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
|
|
|
|
2022-06-08 14:42:04 +00:00
|
|
|
static pax_buf_t pax_buffer;
|
2022-06-08 14:24:28 +00:00
|
|
|
xQueueHandle buttonQueue;
|
2022-01-01 02:06:55 +00:00
|
|
|
|
2022-06-08 14:24:28 +00:00
|
|
|
static const char *TAG = "mch2022-demo-app";
|
2022-05-12 22:13:14 +00:00
|
|
|
|
2022-06-08 14:24:28 +00:00
|
|
|
void disp_flush() {
|
2022-06-08 14:42:04 +00:00
|
|
|
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-03 05:17:22 +00:00
|
|
|
|
2022-06-08 14:24:28 +00:00
|
|
|
// Init GFX.
|
2022-06-08 14:42:04 +00:00
|
|
|
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.
|
2022-06-08 14:42:04 +00:00
|
|
|
pax_background(&pax_buffer, 0xffff00ff);
|
2022-06-08 14:24:28 +00:00
|
|
|
disp_flush();
|
2022-05-31 20:10:08 +00:00
|
|
|
|
2022-06-08 14:24:28 +00:00
|
|
|
// Just wait.
|
|
|
|
while (1) vTaskDelay(10000);
|
2021-12-29 17:34:55 +00:00
|
|
|
}
|