WIP: feature/esp32-ng-basic #1

Draft
localhorst wants to merge 27 commits from feature/esp32-ng-basic into master
15 changed files with 2127 additions and 19 deletions
Showing only changes of commit 1012d3bb2f - Show all commits
-2
View File
@@ -3,7 +3,6 @@
# https://github.com/espressif/esp-idf # https://github.com/espressif/esp-idf
build/ build/
sdkconfig
sdkconfig.old sdkconfig.old
# ---> VisualStudioCode # ---> VisualStudioCode
@@ -187,7 +186,6 @@ cython_debug/
# https://github.com/espressif/esp-idf # https://github.com/espressif/esp-idf
build/ build/
sdkconfig
sdkconfig.old sdkconfig.old
# ---> CMake # ---> CMake
+2 -1
View File
@@ -5,11 +5,12 @@
#include "animation.h" #include "animation.h"
#include "led.h" #include "led.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_timer.h" #include "esp_timer.h"
#include "esp_random.h" #include "esp_random.h"
#include <math.h> #include <math.h>
#include <string.h>
static const char *TAG = "ANIMATION"; static const char *TAG = "ANIMATION";
+2 -1
View File
@@ -6,9 +6,10 @@
#ifndef ANIMATION_H #ifndef ANIMATION_H
#define ANIMATION_H #define ANIMATION_H
#include <stdint.h>
#include "esp_err.h" #include "esp_err.h"
#include <stdint.h>
/** /**
* @brief Animation modes * @brief Animation modes
*/ */
+2 -1
View File
@@ -11,7 +11,6 @@
#include "esp_system.h" #include "esp_system.h"
#include "nvs_flash.h" #include "nvs_flash.h"
#include "nvs.h" #include "nvs.h"
#include "esp_timer.h"
#include <string.h> #include <string.h>
@@ -21,11 +20,13 @@ static const char *TAG = "CONFIG";
#define CONFIG_MAGIC 0xDEADBEEF #define CONFIG_MAGIC 0xDEADBEEF
#define HARDCODED_CONFIG #define HARDCODED_CONFIG
#ifdef HARDCODED_CONFIG
#define HARDCODED_CONFIG_LED_STRIP_A_PIN 12U #define HARDCODED_CONFIG_LED_STRIP_A_PIN 12U
#define HARDCODED_CONFIG_LED_STRIP_B_PIN 14U #define HARDCODED_CONFIG_LED_STRIP_B_PIN 14U
#define HARDCODED_CONFIG_LED_STRIP_A_COUNT 7U #define HARDCODED_CONFIG_LED_STRIP_A_COUNT 7U
#define HARDCODED_CONFIG_LED_STRIP_B_COUNT 7U #define HARDCODED_CONFIG_LED_STRIP_B_COUNT 7U
#define HARDCODED_CONFIG_PWM_PIN 13U #define HARDCODED_CONFIG_PWM_PIN 13U
#endif
// Global state // Global state
static config_t current_config = { static config_t current_config = {
+1
View File
@@ -7,6 +7,7 @@
#define CONFIG_H #define CONFIG_H
#include "esp_err.h" #include "esp_err.h"
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
-4
View File
@@ -13,10 +13,6 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_system.h"
#include "esp_timer.h"
#include <string.h>
static const char *TAG = "CONTROL"; static const char *TAG = "CONTROL";
+1
View File
@@ -7,6 +7,7 @@
#define CONTROL_H #define CONTROL_H
#include "esp_err.h" #include "esp_err.h"
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
+2
View File
@@ -4,10 +4,12 @@
*/ */
#include "led.h" #include "led.h"
#include "driver/rmt_tx.h" #include "driver/rmt_tx.h"
#include "esp_log.h" #include "esp_log.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/semphr.h" #include "freertos/semphr.h"
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
+2 -1
View File
@@ -6,9 +6,10 @@
#ifndef LED_H #ifndef LED_H
#define LED_H #define LED_H
#include <stdint.h>
#include "esp_err.h" #include "esp_err.h"
#include <stdint.h>
#define LED_STRIP_MAX_LEDS 100 // Maximum LEDs per strip #define LED_STRIP_MAX_LEDS 100 // Maximum LEDs per strip
/** /**
+2
View File
@@ -4,12 +4,14 @@
*/ */
#include "localbtn.h" #include "localbtn.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "esp_timer.h" #include "esp_timer.h"
#include "esp_log.h" #include "esp_log.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "soc/gpio_num.h" #include "soc/gpio_num.h"
#include <string.h> #include <string.h>
static const char *TAG = "LOCALBTN"; static const char *TAG = "LOCALBTN";
+2 -1
View File
@@ -6,9 +6,10 @@
#ifndef LOCALBTN_H #ifndef LOCALBTN_H
#define LOCALBTN_H #define LOCALBTN_H
#include "esp_err.h"
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "esp_err.h"
/** /**
* @brief Callback function type for mode changes * @brief Callback function type for mode changes
+5 -4
View File
@@ -3,15 +3,16 @@
* @brief Main application entry point for LED Controller * @brief Main application entry point for LED Controller
*/ */
#include <stdio.h> #include "control.h"
#include "animation.h"
#include "led.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_system.h" #include "esp_system.h"
#include "control.h" #include <stdio.h>
#include "animation.h"
#include "led.h"
static const char *TAG = "MAIN"; static const char *TAG = "MAIN";
+3 -2
View File
@@ -4,19 +4,20 @@
*/ */
#include "rcsignal.h" #include "rcsignal.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "esp_timer.h" #include "esp_timer.h"
#include "esp_log.h" #include "esp_log.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include <string.h> #include <string.h>
static const char *TAG = "RCSIGNAL"; static const char *TAG = "RCSIGNAL";
#define MAX_MODES 14 #define MAX_MODES 14 //TODO: Get from config
#define PULSE_THRESHOLD_US 1500 #define PULSE_THRESHOLD_US 1500
#define SIGNAL_TIMEOUT_MS 100 #define SIGNAL_TIMEOUT_MS 100
static struct static struct
{ {
int8_t gpio_pin; int8_t gpio_pin;
+2 -1
View File
@@ -6,9 +6,10 @@
#ifndef RCSIGNAL_H #ifndef RCSIGNAL_H
#define RCSIGNAL_H #define RCSIGNAL_H
#include "esp_err.h"
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "esp_err.h"
/** /**
* @brief Callback function type for mode changes * @brief Callback function type for mode changes
+2100
View File
File diff suppressed because it is too large Load Diff