custom bootloader code and starting app as task

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-04-12 01:28:08 +02:00
parent fa5b4da0f5
commit e5e602d1fc
6 changed files with 88 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
#include "button_handling.h"
#include "sdkconfig.h"
#include <stdio.h>
#include <string.h>
#include "driver/gpio.h"
@@ -7,6 +8,7 @@
#include "esp_err.h"
#include "esp_log.h"
#include "esp_timer.h"
#include "esp_mac.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
#include "freertos/task.h"

View File

@@ -1,9 +1,5 @@
#pragma once
#include "driver/i2c.h"
void IRAM_ATTR button_isr_handler(void* arg);
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -1,14 +1,19 @@
#include "setup.h"
#include "freertos/idf_additions.h"
#ifdef __cplusplus
extern "C" {
#endif
void app_main(void) {
void app_task(void* param) {
setup();
while(1) {
loop();
}
}
#ifdef __cplusplus
extern "C" {
#endif
void app_main(void) {
xTaskCreatePinnedToCore(app_task, "main_loop", 4096, NULL, 5, NULL, tskIDLE_PRIORITY + 1);
}
#ifdef __cplusplus
}
#endif

View File

@@ -3,7 +3,6 @@
#include <stdio.h>
#include <string.h>
#include "driver/gpio.h"
#include "driver/i2c.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_timer.h"