├── .gitignore ├── pcb ├── m365_esp32_gerbers.zip ├── m365_led_source_gerbers.zip ├── pcb-render-dashboard-top.png ├── pcb-render-led-source-top.png ├── pcb-render-dashboard-bottom.png └── pcb-render-led-source-bottom.png ├── components ├── utils │ ├── CMakeLists.txt │ ├── utils.h │ └── utils.c ├── display │ ├── display.h │ ├── CMakeLists.txt │ └── display.c ├── comm │ ├── CMakeLists.txt │ ├── comm.h │ └── comm.c ├── adc │ ├── CMakeLists.txt │ ├── adc.h │ └── adc.c ├── buzzer │ ├── CMakeLists.txt │ ├── buzzer.h │ └── buzzer.c ├── preferences │ ├── CMakeLists.txt │ ├── preferences.h │ └── preferences.c └── proto │ ├── CMakeLists.txt │ ├── proto.h │ └── proto.c ├── .gitmodules ├── CMakeLists.txt ├── main ├── CMakeLists.txt ├── Kconfig.projbuild └── main.c ├── .clang-format ├── README.md ├── LICENSE ├── backup.ino └── sdkconfig /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | build/ 3 | -------------------------------------------------------------------------------- /pcb/m365_esp32_gerbers.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ursescu/m365_esp_dashboard/HEAD/pcb/m365_esp32_gerbers.zip -------------------------------------------------------------------------------- /pcb/m365_led_source_gerbers.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ursescu/m365_esp_dashboard/HEAD/pcb/m365_led_source_gerbers.zip -------------------------------------------------------------------------------- /pcb/pcb-render-dashboard-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ursescu/m365_esp_dashboard/HEAD/pcb/pcb-render-dashboard-top.png -------------------------------------------------------------------------------- /pcb/pcb-render-led-source-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ursescu/m365_esp_dashboard/HEAD/pcb/pcb-render-led-source-top.png -------------------------------------------------------------------------------- /components/utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB SOURCES *.c) 2 | idf_component_register(SRCS ${SOURCES} INCLUDE_DIRS "." REQUIRES log) 3 | -------------------------------------------------------------------------------- /pcb/pcb-render-dashboard-bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ursescu/m365_esp_dashboard/HEAD/pcb/pcb-render-dashboard-bottom.png -------------------------------------------------------------------------------- /pcb/pcb-render-led-source-bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ursescu/m365_esp_dashboard/HEAD/pcb/pcb-render-led-source-bottom.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "externals/ESP32_TFT_library"] 2 | path = externals/ESP32_TFT_library 3 | url = ../../rontav/ESP32_TFT_library.git 4 | -------------------------------------------------------------------------------- /components/display/display.h: -------------------------------------------------------------------------------- 1 | #ifndef _DISPLAY_H_ 2 | #define _DISPLAY_H_ 3 | 4 | void display_refresh(void); 5 | 6 | void display_init(void); 7 | 8 | #endif -------------------------------------------------------------------------------- /components/comm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB SOURCES *.c) 2 | idf_component_register(SRCS ${SOURCES} 3 | INCLUDE_DIRS "." 4 | REQUIRES utils) 5 | -------------------------------------------------------------------------------- /components/adc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB SOURCES *.c) 2 | idf_component_register(SRCS ${SOURCES} 3 | INCLUDE_DIRS "." 4 | REQUIRES utils proto) 5 | -------------------------------------------------------------------------------- /components/buzzer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB SOURCES *.c) 2 | idf_component_register(SRCS ${SOURCES} 3 | INCLUDE_DIRS "." 4 | REQUIRES utils) 5 | -------------------------------------------------------------------------------- /components/adc/adc.h: -------------------------------------------------------------------------------- 1 | #ifndef _ADC_H_ 2 | #define _ADC_H_ 3 | 4 | #include 5 | 6 | void adc_init(void); 7 | uint8_t adc_speed(void); 8 | uint8_t adc_brake(void); 9 | 10 | #endif -------------------------------------------------------------------------------- /components/display/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB SOURCES *.c) 2 | idf_component_register(SRCS ${SOURCES} 3 | INCLUDE_DIRS "." 4 | REQUIRES tft utils) 5 | -------------------------------------------------------------------------------- /components/preferences/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB SOURCES *.c) 2 | idf_component_register(SRCS ${SOURCES} 3 | INCLUDE_DIRS "." 4 | REQUIRES utils nvs_flash) 5 | -------------------------------------------------------------------------------- /components/proto/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB SOURCES *.c) 2 | idf_component_register(SRCS ${SOURCES} 3 | INCLUDE_DIRS "." 4 | REQUIRES utils comm adc buzzer) 5 | -------------------------------------------------------------------------------- /components/buzzer/buzzer.h: -------------------------------------------------------------------------------- 1 | #ifndef _BUZZER_H_ 2 | #define _BUZZER_H_ 3 | #include 4 | 5 | void buzzer_init(void); 6 | 7 | void buzzer_default_beep(void); 8 | void buzzer_beep(uint32_t, uint32_t, uint32_t, uint8_t); 9 | 10 | #endif -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 6 | set(EXTRA_COMPONENT_DIRS 7 | externals/ESP32_TFT_library/components) 8 | 9 | project(m365-dashboard) -------------------------------------------------------------------------------- /main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCES main.c) 2 | idf_component_register( 3 | SRCS ${SOURCES} 4 | INCLUDE_DIRS 5 | ${CMAKE_CURRENT_LIST_DIR} 6 | $ENV{IDF_PATH}/components 7 | REQUIRES 8 | tft 9 | adc 10 | buzzer 11 | comm 12 | display 13 | proto 14 | utils 15 | preferences 16 | ) -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: google 2 | AllowShortIfStatementsOnASingleLine: false 3 | AllowShortLoopsOnASingleLine: false 4 | AllowShortFunctionsOnASingleLine: None 5 | AllowShortBlocksOnASingleLine: false 6 | AlwaysBreakBeforeMultilineStrings: false 7 | IndentWidth: 4 8 | PointerBindsToType: false 9 | ColumnLimit: 0 10 | SpaceBeforeParens: ControlStatements 11 | SortIncludes: false -------------------------------------------------------------------------------- /components/utils/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef _UTILS_H_ 2 | #define _UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | extern const char *TAG; 8 | 9 | #include "esp_log.h" 10 | #include "sdkconfig.h" 11 | 12 | #define DEBUG_BUFF_SIZE (CONFIG_M365_BUFF_SIZE) 13 | 14 | void print_command(const uint8_t *, const uint16_t); 15 | 16 | uint32_t map(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); 17 | 18 | #endif -------------------------------------------------------------------------------- /components/preferences/preferences.h: -------------------------------------------------------------------------------- 1 | #ifndef _PREFERENCES_H_ 2 | #define _PREFERENCES_H_ 3 | 4 | #include "utils.h" 5 | 6 | #define NVS_NAMESPACE "M365" 7 | 8 | #pragma pack(push, 1) 9 | typedef struct { 10 | uint8_t size; 11 | uint8_t max_speed; 12 | uint8_t min_speed; 13 | char name[10]; 14 | } Preferences; 15 | #pragma pack(pop) 16 | 17 | bool preferences_init(void); 18 | bool preferences_save(void); 19 | void preferences_print(void); 20 | 21 | extern Preferences dashboard_preferences; 22 | 23 | #endif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # M365 Dashboard replacement 2 | 3 | ## Description 4 | 5 | Replacement for BLE m365 scooter dashboard using ESP32 chip. 6 | 7 | ## Build 8 | 9 | Clone official esp-idf sdk repo and set `IDF_PATH` environment variable 10 | to point it. 11 | 12 | ```bash 13 | git clone --recursive https://github.com/espressif/esp-idf.git ~/esp-idf 14 | 15 | cd ~/esp-idf && ./install.sh && . ./export.sh 16 | ``` 17 | 18 | Build app and watch the info using `make`. 19 | 20 | ```bash 21 | make flash monitor 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2019 Ionut Ursescu 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see . -------------------------------------------------------------------------------- /components/utils/utils.c: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | const char *TAG = "M365"; 4 | 5 | uint8_t debug[DEBUG_BUFF_SIZE + 1] = { 6 | 0, 7 | }; 8 | 9 | void print_command(const uint8_t *data, const uint16_t size) { 10 | if ((size * 2) > DEBUG_BUFF_SIZE) { 11 | printf("%s : Debug buffer to small %d > %d\n", __func__, size, DEBUG_BUFF_SIZE); 12 | 13 | return; 14 | } 15 | 16 | for (uint8_t index = 0; index < size; index++) { 17 | sprintf((char *)(debug + (index * 2)), "%02x", data[index]); 18 | } 19 | 20 | debug[size * 2] = 0; // Null terminator 21 | printf("%s : Received size %d : %s \n", __func__, size, debug); 22 | } 23 | 24 | uint32_t map(uint32_t x, uint32_t in_min, uint32_t in_max, uint32_t out_min, uint32_t out_max) { 25 | return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; 26 | } 27 | -------------------------------------------------------------------------------- /components/comm/comm.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMM_H_ 2 | #define _COMM_H_ 3 | 4 | #include "driver/uart.h" 5 | #include "driver/gpio.h" 6 | #include 7 | #include "sdkconfig.h" 8 | 9 | #define COMM_PIN_TXD (CONFIG_M365_TX_GPIO) 10 | #define COMM_PIN_RXD (CONFIG_M365_RX_GPIO) 11 | 12 | /* The interval needed to send data */ 13 | #define TX_INTERVAL (CONFIG_M365_TX_INTERVAL) 14 | 15 | /* Timeout for response */ 16 | #define RX_TIMEOUT (CONFIG_M365_RX_TIMEOUT) 17 | 18 | /* Timeout connection */ 19 | #define COMM_TIMEOUT (1000) 20 | 21 | #define COMM_BUFF_SIZE (CONFIG_M365_BUFF_SIZE) 22 | 23 | #define UART_DEVICE (CONFIG_M365_UART_DEVICE) 24 | 25 | typedef struct { 26 | uint8_t tx[COMM_BUFF_SIZE]; 27 | uint32_t tx_size; 28 | uint8_t rx[COMM_BUFF_SIZE]; 29 | uint32_t rx_size; 30 | } comm_chan; 31 | 32 | void comm_init(void); 33 | void comm_send(comm_chan *); 34 | void comm_recv(comm_chan *); 35 | 36 | void comm_copy_tx_chan(comm_chan *, uint8_t *, uint32_t); 37 | 38 | #endif -------------------------------------------------------------------------------- /components/proto/proto.h: -------------------------------------------------------------------------------- 1 | #ifndef _PROTO_H_ 2 | #define _PROTO_H_ 3 | 4 | #include 5 | #include "comm.h" 6 | 7 | #include "freertos/queue.h" 8 | 9 | #define CRC0_MASK (0xff00) 10 | #define CRC0_SHIFT (8) 11 | 12 | #define CRC1_MASK (0x00ff) 13 | #define CRC1_SHIFT (0) 14 | 15 | #define PROTO_CONSTANT (1.60934) 16 | #define PROTO_COMMAND_HEADER0 (0x55) 17 | #define PROTO_COMMAND_HEADER1 (0xAA) 18 | 19 | #define PROTO_ADC_MIN (0x28) 20 | #define PROTO_ADC_MAX (0xC2) 21 | #define PROTO_ADC_MAX_THRESHOLD (CONFIG_M365_ADC_MAX_THRESHOLD) 22 | 23 | typedef struct __stat { 24 | uint8_t alarmStatus; 25 | uint8_t averageVelocity; 26 | uint8_t battery; 27 | uint8_t beep; 28 | uint8_t brakeConnected; 29 | uint8_t cruise; 30 | uint8_t eco; 31 | uint8_t ecoMode; 32 | uint8_t hasConnected; 33 | uint8_t isConnected; 34 | uint8_t led; 35 | uint8_t lock; 36 | uint8_t night; 37 | uint8_t odometer; 38 | uint8_t tail; 39 | uint8_t temperature; 40 | uint8_t throttleConnected; 41 | uint8_t velocity; 42 | } proto_stat; 43 | 44 | void proto_add_crc(uint8_t *, uint8_t); 45 | uint8_t proto_verify_crc(uint8_t *, uint8_t); 46 | uint16_t proto_crc(const uint8_t *, uint16_t); 47 | void proto_command(comm_chan *, QueueHandle_t); 48 | 49 | #endif -------------------------------------------------------------------------------- /components/comm/comm.c: -------------------------------------------------------------------------------- 1 | #include "comm.h" 2 | 3 | void comm_init(void) { 4 | /* Init serial */ 5 | uart_config_t uart_config = { 6 | .baud_rate = 115200, 7 | .data_bits = UART_DATA_8_BITS, 8 | .parity = UART_PARITY_DISABLE, 9 | .stop_bits = UART_STOP_BITS_1, 10 | .flow_ctrl = UART_HW_FLOWCTRL_DISABLE}; 11 | 12 | /* Init uart 1 */ 13 | uart_param_config(UART_DEVICE, &uart_config); 14 | uart_set_pin(UART_DEVICE, COMM_PIN_TXD, COMM_PIN_RXD, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); 15 | 16 | uart_driver_install(UART_DEVICE, COMM_BUFF_SIZE * 2, 0, 0, NULL, 0); 17 | } 18 | 19 | void comm_send(comm_chan *channel) { 20 | uart_write_bytes(UART_DEVICE, (const char *)(channel->tx), channel->tx_size); 21 | } 22 | 23 | void comm_recv(comm_chan *channel) { 24 | uint32_t recv = uart_read_bytes(UART_DEVICE, channel->rx, COMM_BUFF_SIZE, RX_TIMEOUT / portTICK_RATE_MS); 25 | 26 | channel->rx_size = recv; 27 | }; 28 | 29 | inline void comm_copy_tx_chan(comm_chan *channel, uint8_t *data, uint32_t size) { 30 | if (size >= COMM_BUFF_SIZE) { 31 | /* Too much data */ 32 | printf("%s : Communication channel buffer to small %d > %d\n", __func__, size, COMM_BUFF_SIZE); 33 | return; 34 | } 35 | 36 | channel->tx_size = size; 37 | 38 | /* Copy data to tx channel */ 39 | memcpy(channel->tx, data, size); 40 | } -------------------------------------------------------------------------------- /components/adc/adc.c: -------------------------------------------------------------------------------- 1 | #include "driver/adc.h" 2 | 3 | #include "adc.h" 4 | #include "proto.h" 5 | #include "utils.h" 6 | #include "driver/gpio.h" 7 | 8 | #define DEFAULT_VREF 1100 9 | #define NO_OF_SAMPLES 64 10 | 11 | #define ACCEL_CHANNEL (CONFIG_M365_ACCEL_CHANNEL) 12 | #define BRAKE_CHANNEL (CONFIG_M365_BRAKE_CHANNEL) 13 | 14 | uint16_t accel_adc_min = 1000; 15 | uint16_t accel_adc_max = 2700; 16 | 17 | uint16_t brake_adc_min = 1000; 18 | uint16_t brake_adc_max = 2700; 19 | 20 | void adc_init(void) { 21 | adc1_config_width(ADC_WIDTH_BIT_12); 22 | adc1_config_channel_atten(ACCEL_CHANNEL, ADC_ATTEN_11db); 23 | adc1_config_channel_atten(BRAKE_CHANNEL, ADC_ATTEN_11db); 24 | } 25 | 26 | uint8_t adc_speed(void) { 27 | uint32_t adc_reading = 0; 28 | // Multisampling 29 | for (int i = 0; i < NO_OF_SAMPLES; i++) { 30 | adc_reading += adc1_get_raw(ACCEL_CHANNEL); 31 | } 32 | adc_reading /= NO_OF_SAMPLES; 33 | 34 | if (adc_reading > accel_adc_max) { 35 | accel_adc_max = (uint16_t)adc_reading; 36 | } 37 | if (adc_reading < accel_adc_min) { 38 | accel_adc_min = (uint16_t)adc_reading; 39 | } 40 | 41 | uint8_t accel_output = (uint8_t)map(adc_reading, accel_adc_min, accel_adc_max, PROTO_ADC_MIN, PROTO_ADC_MAX); 42 | 43 | if (accel_output > PROTO_ADC_MAX_THRESHOLD) { 44 | accel_output = PROTO_ADC_MAX; 45 | } 46 | 47 | return accel_output; 48 | } 49 | 50 | uint8_t adc_brake(void) { 51 | uint32_t adc_reading = 0; 52 | // Multisampling 53 | for (int i = 0; i < NO_OF_SAMPLES; i++) { 54 | adc_reading += adc1_get_raw(BRAKE_CHANNEL); 55 | } 56 | adc_reading /= NO_OF_SAMPLES; 57 | 58 | if (adc_reading > brake_adc_max) { 59 | brake_adc_max = (uint16_t)adc_reading; 60 | } 61 | if (adc_reading < brake_adc_min) { 62 | brake_adc_min = (uint16_t)adc_reading; 63 | } 64 | 65 | uint8_t brake_output = (uint8_t)map(adc_reading, brake_adc_min, brake_adc_max, PROTO_ADC_MIN, PROTO_ADC_MAX); 66 | 67 | if (brake_output > PROTO_ADC_MAX_THRESHOLD) { 68 | brake_output = PROTO_ADC_MAX; 69 | } 70 | 71 | return brake_output; 72 | } -------------------------------------------------------------------------------- /components/buzzer/buzzer.c: -------------------------------------------------------------------------------- 1 | #include "buzzer.h" 2 | #include 3 | #include "driver/ledc.h" 4 | #include "freertos/FreeRTOS.h" 5 | #include "freertos/timers.h" 6 | 7 | #define LEDC_HS_TIMER LEDC_TIMER_0 8 | #define LEDC_HS_MODE LEDC_HIGH_SPEED_MODE 9 | 10 | #define LEDC_HS_CH0_GPIO (CONFIG_M365_BUZZER_GPIO) 11 | #define LEDC_HS_CH0_CHANNEL LEDC_CHANNEL_0 12 | 13 | #define LEDC_TEST_DUTY (4000) 14 | 15 | #define DEFAULT_BEEP_DURATION (CONFIG_M365_BEEP_DURATION) 16 | 17 | #define DEFAULT_BEEP_FREQ (CONFIG_M365_BUZZER_FREQ) 18 | 19 | static ledc_timer_config_t ledc_timer; 20 | 21 | static ledc_channel_config_t ledc_channel; 22 | 23 | void buzzer_init(void) { 24 | ledc_timer = (ledc_timer_config_t){ 25 | .duty_resolution = LEDC_TIMER_13_BIT, // resolution of PWM duty 26 | .freq_hz = DEFAULT_BEEP_FREQ, // frequency of PWM signal 27 | .speed_mode = LEDC_HS_MODE, // timer mode 28 | .timer_num = LEDC_HS_TIMER, // timer index 29 | .clk_cfg = LEDC_AUTO_CLK, // Auto select the source clock 30 | }; 31 | 32 | // Set configuration of timer0 for high speed channels 33 | ledc_timer_config(&ledc_timer); 34 | 35 | ledc_channel = (ledc_channel_config_t){ 36 | .channel = LEDC_HS_CH0_CHANNEL, 37 | .duty = LEDC_TEST_DUTY, 38 | .gpio_num = LEDC_HS_CH0_GPIO, 39 | .speed_mode = LEDC_HS_MODE, 40 | .hpoint = 0, 41 | .timer_sel = LEDC_HS_TIMER, 42 | }; 43 | } 44 | 45 | static void stop_buzzer(TimerHandle_t timerHandler) { 46 | ledc_stop(ledc_channel.speed_mode, ledc_channel.channel, 1); 47 | } 48 | 49 | void buzzer_default_beep() { 50 | ledc_channel_config(&ledc_channel); 51 | 52 | uint32_t id = 2; 53 | TimerHandle_t tmr; 54 | 55 | tmr = xTimerCreate("buzzer", pdMS_TO_TICKS(DEFAULT_BEEP_DURATION), pdFALSE, (void*)id, &stop_buzzer); 56 | if (xTimerStart(tmr, 10) != pdPASS) { 57 | /* Failed to create timer task */ 58 | printf("Failed to create timer/n"); 59 | while (1) { 60 | /* Spin forever */ 61 | } 62 | } 63 | } 64 | 65 | /* LEDC esp32 documentation */ 66 | void buzzer_beep(uint32_t freq, uint32_t on_time, uint32_t off_time, uint8_t beeps) { 67 | printf("Beep\n"); 68 | } -------------------------------------------------------------------------------- /backup.ino: -------------------------------------------------------------------------------- 1 | 2 | int throttleInput = A2; 3 | int stopInput = 5; 4 | int breakInput = A3; 5 | 6 | void setup() { 7 | Serial1.begin(115200); 8 | pinMode(throttleInput, INPUT); 9 | pinMode(breakInput, INPUT); 10 | pinMode(stopInput, INPUT); 11 | } 12 | 13 | 14 | 15 | 16 | 17 | #define SPEED_POS 7 18 | #define BRAKE_POS 8 19 | 20 | unsigned char motor[] = {0x55, 0xAA, 0x7, 0x20, 0x65, 0x0, 0x4, 0x00, 0x00, 0x0, 0x0, 0x0, 0x0}; 21 | unsigned char motor1[] = {0x55, 0xAA, 0x9, 0x20, 0x64, 0x0, 0x6, 0x00, 0x00, 0x0, 0x0, 0x72, 0x0, 0x0, 0x0}; 22 | 23 | 24 | void sendESCMotor(){ 25 | 26 | uint16_t speed, breakS; 27 | speed = analogRead(throttleInput); 28 | breakS = analogRead(breakInput); 29 | uint8_t speed2 = map(speed, 170, 870, 0x26, 0xC2); 30 | uint8_t breakS2 = map(breakS, 170, 870, 0x26, 0xC2); 31 | 32 | // uint8_t breakS = 0x26; 33 | // if(digitalRead(stopInput)){ 34 | // speed2 = 0x26; 35 | // breakS = 0x26; 36 | // } 37 | // Serial.println("Salut"); 38 | // Serial.println(speed2, HEX); 39 | // Serial.println(breakS2, HEX); 40 | 41 | // 42 | // speed2 = 0x28; 43 | // breakS2 = 0x28; 44 | 45 | motor[SPEED_POS] = speed2; 46 | motor[BRAKE_POS] = breakS2; 47 | 48 | motor1[SPEED_POS] = speed2; 49 | motor1[BRAKE_POS] = breakS2; 50 | // 51 | // Serial1.println(speed2, HEX); 52 | // 53 | // Serial1.println(breakS2, HEX); 54 | // Serial1.println("Salut"); 55 | uint16_t calc = 0; 56 | for(int x = 2; x < sizeof(motor) - 2; x++) calc += motor[x]; 57 | calc ^= 0xffff; 58 | motor[11] = (uint8_t)(calc&0xff); 59 | motor[12] = (uint8_t)((calc&0xff00) >> 8); 60 | 61 | calc = 0; 62 | for(int x = 2; x < sizeof(motor1) - 2; x++) calc += motor1[x]; 63 | calc ^= 0xffff; 64 | motor1[13] = (uint8_t)(calc&0xff); 65 | motor1[14] = (uint8_t)((calc&0xff00) >> 8); 66 | 67 | // for(int x = 0; x < sizeof(motor1); x++){ 68 | // Serial.println(motor1[x], HEX); 69 | // } 70 | // 71 | Serial1.write(motor, sizeof(motor)); 72 | delay(10); 73 | Serial1.write(motor,sizeof(motor)); 74 | delay(10); 75 | Serial1.write(motor,sizeof(motor)); 76 | delay(10); 77 | Serial1.write(motor,sizeof(motor)); 78 | delay(10); 79 | Serial1.write(motor1,sizeof(motor1)); 80 | } 81 | 82 | uint8_t unlockStatus = 0; 83 | void loop() { 84 | sendESCMotor(); 85 | } 86 | -------------------------------------------------------------------------------- /components/preferences/preferences.c: -------------------------------------------------------------------------------- 1 | #include "preferences.h" 2 | 3 | #include 4 | 5 | #include "nvs.h" 6 | #include "nvs_flash.h" 7 | #include "esp_system.h" 8 | 9 | #define TAG "preferences" 10 | 11 | nvs_handle_t handle; 12 | Preferences dashboard_preferences; 13 | 14 | /* 15 | * Default config preferences. Update it when preferences 16 | * structure is changed. 17 | */ 18 | static const Preferences default_preferences = (Preferences){ 19 | .size = 10, 20 | .max_speed = 20, 21 | .min_speed = 15, 22 | .name = "Default", 23 | }; 24 | 25 | bool preferences_init(void) { 26 | esp_err_t err; 27 | 28 | err = nvs_flash_init(); 29 | if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) { 30 | ESP_LOGI(TAG, "NVS partition was truncated and needs to be erased"); 31 | return false; 32 | } 33 | 34 | ESP_LOGI(TAG, "Opening Non-Volatile Storage (NVS) handle"); 35 | err = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &handle); 36 | 37 | if (err != ESP_OK) { 38 | ESP_LOGI(TAG, "nvs_open failed: %s", esp_err_to_name(err)); 39 | return false; 40 | } 41 | ESP_LOGI(TAG, "Done"); 42 | 43 | /* 44 | * Read the saved preferences from NVS into the extern dashboard_preferences. 45 | */ 46 | ESP_LOGI(TAG, "Reading saved preferences NVS"); 47 | 48 | // Read the size of memory space required for preferinces 49 | size_t saved_size = 0; // value will default to 0, if not set yet in NVS 50 | err = nvs_get_blob(handle, "preferences", NULL, &saved_size); 51 | 52 | if (err != ESP_OK && err != ESP_ERR_NVS_NOT_FOUND) { 53 | ESP_LOGE(TAG, "Failed to get preferences size: %s", esp_err_to_name(err)); 54 | return false; 55 | } 56 | 57 | // Read previously saved preferences if available 58 | if (saved_size == sizeof(Preferences)) { 59 | // Size of preferences matching . 60 | 61 | err = nvs_get_blob(handle, "preferences", &dashboard_preferences, &saved_size); 62 | if (err != ESP_OK) { 63 | ESP_LOGE(TAG, "Failed to read the preferences: %s", esp_err_to_name(err)); 64 | return false; 65 | } 66 | } else { 67 | // Drop saved preferences, missmatch or not saved. 68 | ESP_LOGI(TAG, "Drop saved preferences, missmatch of preference structure size. Set the default preferences"); 69 | memcpy(&dashboard_preferences, &default_preferences, sizeof(Preferences)); 70 | } 71 | 72 | nvs_close(handle); 73 | 74 | return true; 75 | } 76 | 77 | bool preferences_save(void) { 78 | esp_err_t err; 79 | 80 | ESP_LOGI(TAG, "Opening Non-Volatile Storage (NVS) handle..."); 81 | err = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &handle); 82 | 83 | if (err != ESP_OK) { 84 | ESP_LOGE(TAG, "nvs_open failed: %s", esp_err_to_name(err)); 85 | return false; 86 | } 87 | ESP_LOGI(TAG, "Done"); 88 | 89 | err = nvs_set_blob(handle, "preferences", &dashboard_preferences, sizeof(Preferences)); 90 | 91 | if (err != ESP_OK) { 92 | ESP_LOGE(TAG, "Failed to save preferences failed: %s", esp_err_to_name(err)); 93 | nvs_close(handle); 94 | return false; 95 | } 96 | 97 | // Commit 98 | err = nvs_commit(handle); 99 | if (err != ESP_OK) { 100 | ESP_LOGE(TAG, "Failed to commit preferences: %s", esp_err_to_name(err)); 101 | nvs_close(handle); 102 | return false; 103 | } 104 | 105 | // Close 106 | nvs_close(handle); 107 | return true; 108 | } 109 | 110 | void preferences_print(void) { 111 | ESP_LOGI(TAG, "size: %hhu\n", dashboard_preferences.size); 112 | ESP_LOGI(TAG, "max speed: %hhu\n", dashboard_preferences.max_speed); 113 | ESP_LOGI(TAG, "min speed: %hhu\n", dashboard_preferences.min_speed); 114 | ESP_LOGI(TAG, "name: %s\n", dashboard_preferences.name); 115 | } 116 | -------------------------------------------------------------------------------- /main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "M365 Dashboard" 2 | 3 | config M365_UART_DEVICE 4 | int 5 | default 0 if M365_UART_DEVICE0 6 | default 1 if M365_UART_DEVICE1 7 | default 2 if M365_UART_DEVICE2 8 | choice 9 | prompt "Select UART device for M365 communication" 10 | default M365_UART_DEVICE1 11 | 12 | config M365_UART_DEVICE0 13 | bool "UART 0" 14 | config M365_UART_DEVICE1 15 | bool "UART 1" 16 | config M365_UART_DEVICE2 17 | bool "UART 2" 18 | endchoice 19 | 20 | config M365_BUFF_SIZE 21 | int "Buffer size for M365 communication (bytes)" 22 | default 128 23 | 24 | config M365_TX_GPIO 25 | int "UART TX GPIO used for M365 communication" 26 | default 17 27 | 28 | config M365_RX_GPIO 29 | int "UART RX GPIO used for M365 communication" 30 | default 16 31 | 32 | config M365_TX_INTERVAL 33 | int "M365 transmission interval (ms)" 34 | default 50 35 | 36 | config M365_RX_TIMEOUT 37 | int "M365 response timeout (ms)" 38 | default 10 39 | 40 | config M365_ACCEL_CHANNEL 41 | int 42 | default 0 if M365_ACCEL_CHANNEL0 43 | default 1 if M365_ACCEL_CHANNEL1 44 | default 2 if M365_ACCEL_CHANNEL2 45 | default 3 if M365_ACCEL_CHANNEL3 46 | default 4 if M365_ACCEL_CHANNEL4 47 | default 5 if M365_ACCEL_CHANNEL5 48 | default 6 if M365_ACCEL_CHANNEL6 49 | default 7 if M365_ACCEL_CHANNEL7 50 | choice 51 | prompt "Select ADC channel for acceleration sensor" 52 | default M365_ACCEL_CHANNEL6 53 | 54 | config M365_ACCEL_CHANNEL0 55 | bool "ADC1_CH0 GPIO36" 56 | config M365_ACCEL_CHANNEL1 57 | bool "ADC1_CH1 GPIO37" 58 | config M365_ACCEL_CHANNEL2 59 | bool "ADC1_CH2 GPIO38" 60 | config M365_ACCEL_CHANNEL3 61 | bool "ADC1_CH3 GPIO39" 62 | config M365_ACCEL_CHANNEL4 63 | bool "ADC1_CH4 GPIO32" 64 | config M365_ACCEL_CHANNEL5 65 | bool "ADC1_CH5 GPIO33" 66 | config M365_ACCEL_CHANNEL6 67 | bool "ADC1_CH6 GPIO34" 68 | config M365_ACCEL_CHANNEL7 69 | bool "ADC1_CH7 GPIO35" 70 | endchoice 71 | 72 | config M365_BRAKE_CHANNEL 73 | int 74 | default 0 if M365_BRAKE_CHANNEL0 75 | default 1 if M365_BRAKE_CHANNEL1 76 | default 2 if M365_BRAKE_CHANNEL2 77 | default 3 if M365_BRAKE_CHANNEL3 78 | default 4 if M365_BRAKE_CHANNEL4 79 | default 5 if M365_BRAKE_CHANNEL5 80 | default 6 if M365_BRAKE_CHANNEL6 81 | default 7 if M365_BRAKE_CHANNEL7 82 | choice 83 | prompt "Select ADC channel for brake sensor" 84 | default M365_BRAKE_CHANNEL7 85 | 86 | config M365_BRAKE_CHANNEL0 87 | bool "ADC1_CH0 GPIO36" 88 | config M365_BRAKE_CHANNEL1 89 | bool "ADC1_CH1 GPIO37" 90 | config M365_BRAKE_CHANNEL2 91 | bool "ADC1_CH2 GPIO38" 92 | config M365_BRAKE_CHANNEL3 93 | bool "ADC1_CH3 GPIO39" 94 | config M365_BRAKE_CHANNEL4 95 | bool "ADC1_CH4 GPIO32" 96 | config M365_BRAKE_CHANNEL5 97 | bool "ADC1_CH5 GPIO33" 98 | config M365_BRAKE_CHANNEL6 99 | bool "ADC1_CH6 GPIO34" 100 | config M365_BRAKE_CHANNEL7 101 | bool "ADC1_CH7 GPIO35" 102 | endchoice 103 | 104 | config M365_ADC_MAX_THRESHOLD 105 | int "ADC MAX Threshold" 106 | range 40 194 107 | default 190 108 | help 109 | If the acceleration/brake output is greater than this value, 110 | set the output to ADC_MAX. This exists so that the sensor 111 | noise won't matter when you have the throttle/brake hold down 112 | all the way. 113 | 114 | config M365_BUZZER_GPIO 115 | int "BUZZER GPIO" 116 | default 18 117 | 118 | config M365_BUZZER_FREQ 119 | int "Buzzer frequency" 120 | default 4000 121 | 122 | config M365_BEEP_DURATION 123 | int "Beep duration" 124 | default 500 125 | 126 | endmenu 127 | -------------------------------------------------------------------------------- /main/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | *Main file 3 | */ 4 | #include "freertos/FreeRTOS.h" 5 | #include "freertos/portable.h" 6 | #include "freertos/queue.h" 7 | #include "freertos/semphr.h" 8 | #include "freertos/task.h" 9 | #include "freertos/timers.h" 10 | #include "esp32/clk.h" 11 | #include "esp_log.h" 12 | 13 | #include "soc/rtc.h" 14 | #include "soc/rtc_cntl_reg.h" 15 | 16 | #include 17 | #include 18 | 19 | #define TAG "main" 20 | #define PROCESS_CPU 0 21 | #define COMM_CPU 1 22 | 23 | #include "comm.h" 24 | #include "buzzer.h" 25 | #include "proto.h" 26 | #include "display.h" 27 | #include "utils.h" 28 | #include "adc.h" 29 | #include "preferences.h" 30 | 31 | /* Communication channel */ 32 | comm_chan uart_channel; 33 | 34 | /* Sempahore to control the order of tasks */ 35 | SemaphoreHandle_t rx_sem = NULL; 36 | SemaphoreHandle_t comm_sem = NULL; 37 | 38 | QueueHandle_t display_queue; 39 | 40 | static void tx_task(TimerHandle_t xTimer) { 41 | /* Tx task 42 | * Send data at known time interval 43 | */ 44 | 45 | if (uart_channel.tx_size > 0) 46 | comm_send(&uart_channel); 47 | 48 | /* Command written, now let the rx_task, wait for response */ 49 | xSemaphoreGive(rx_sem); 50 | } 51 | 52 | static void rx_task() { 53 | /* Rx task 54 | * Listen for data after the tx is done 55 | */ 56 | 57 | while (1) { 58 | /* Wait to receive signal from tx_task */ 59 | xSemaphoreTake(rx_sem, portMAX_DELAY); 60 | 61 | /* Receive data from channel */ 62 | comm_recv(&uart_channel); 63 | 64 | // print_command(uart_channel.rx, uart_channel.rx_size); 65 | 66 | /* Pass control to comm_task */ 67 | xSemaphoreGive(comm_sem); 68 | } 69 | } 70 | 71 | static void comm_task() { 72 | /* Communication task 73 | * This is the place where the incoming commands are verified 74 | * and next command is set 75 | */ 76 | 77 | while (1) { 78 | /* Wait to receive signal from rx_task */ 79 | xSemaphoreTake(comm_sem, portMAX_DELAY); 80 | 81 | /* 82 | * Using half duplex UART will cause to read from the tx, 83 | * flushig UART Buffer seems to be too slow to clear the buffer before rx 84 | */ 85 | 86 | /* Process command and prepare the sending command */ 87 | proto_command(&uart_channel, display_queue); 88 | 89 | /* Done processing command */ 90 | } 91 | } 92 | 93 | static void display_task() { 94 | /* Dsiplay task 95 | * This will update the info from the BMS and ESC 96 | * The timing it's not that important for this task, update when 97 | * nothing else is doing work 98 | */ 99 | 100 | display_init(); 101 | 102 | while (1) { 103 | /* Get from queue and process it */ 104 | 105 | /* data = queue get */ 106 | 107 | display_refresh(); 108 | /* update(data) */ 109 | } 110 | } 111 | 112 | void app_main() { 113 | /* Esp-idf entry point */ 114 | 115 | /* Debug, show frequency */ 116 | rtc_cpu_freq_config_t old_config; 117 | rtc_clk_cpu_freq_get_config(&old_config); 118 | 119 | ESP_LOGI(TAG, "Main app, running freq %d", old_config.freq_mhz); 120 | ESP_LOGI(TAG, "Core id: %d", xPortGetCoreID()); 121 | /* End debug */ 122 | 123 | preferences_init(); 124 | 125 | /* Init ADC */ 126 | adc_init(); 127 | 128 | /* Init Buzzer */ 129 | buzzer_init(); 130 | 131 | /* Init communication channel */ 132 | comm_init(); 133 | 134 | /* Init semaphores used to dictate the tasks */ 135 | rx_sem = xSemaphoreCreateBinary(); 136 | comm_sem = xSemaphoreCreateBinary(); 137 | 138 | if (rx_sem == NULL || comm_sem == NULL) { 139 | /* Failed to init semaphore */ 140 | ESP_LOGE(TAG, "Failed to create semaphores\n"); 141 | while (1) { 142 | /* Spin forever */ 143 | } 144 | } 145 | 146 | /* This is the main task to send data. 147 | * I need to be sure that command is prepared until next period. (20 ms) 148 | */ 149 | int id = 1; 150 | TimerHandle_t tmr; 151 | 152 | tmr = xTimerCreate("tx_task", pdMS_TO_TICKS(TX_INTERVAL), pdTRUE, (void*)id, &tx_task); 153 | if (xTimerStart(tmr, 10) != pdPASS) { 154 | /* Failed to create timer task */ 155 | ESP_LOGE(TAG, "Failed to create timer\n"); 156 | while (1) { 157 | /* Spin forever */ 158 | } 159 | } 160 | 161 | // processing is done on core 0 162 | xTaskCreatePinnedToCore(comm_task, "comm_task", 1024 * 4, NULL, configMAX_PRIORITIES, NULL, PROCESS_CPU); 163 | 164 | // // update the output on core 0 165 | xTaskCreatePinnedToCore(display_task, "disp_task", 1024 * 4, NULL, configMAX_PRIORITIES - 1, NULL, PROCESS_CPU); 166 | 167 | // rx is done on core 1 168 | xTaskCreatePinnedToCore(rx_task, "rx_task", 1024 * 4, NULL, configMAX_PRIORITIES, NULL, COMM_CPU); 169 | } 170 | -------------------------------------------------------------------------------- /components/proto/proto.c: -------------------------------------------------------------------------------- 1 | #include "proto.h" 2 | 3 | #include "adc.h" 4 | #include "utils.h" 5 | #include "buzzer.h" 6 | #include "comm.h" 7 | 8 | #include 9 | 10 | /* Get current time macro */ 11 | #define GET_TIME() ((uint32_t)(clock() * 1000 / CLOCKS_PER_SEC)) 12 | 13 | /* Protocol status structure 14 | * Maintaining the state between commands 15 | */ 16 | proto_stat stats; 17 | 18 | uint32_t last_valid_message_time; 19 | 20 | uint8_t proto_verify_crc(uint8_t *message, uint8_t size) { 21 | unsigned long cksm = 0; 22 | for (int i = 2; i < size - 2; i++) 23 | cksm += message[i]; 24 | cksm ^= 0xFFFF; 25 | 26 | if (cksm == message[size - 2] + (message[size - 1] << 8)) { 27 | return 1; 28 | } 29 | return 0; 30 | } 31 | 32 | void proto_add_crc(uint8_t *message, uint8_t size) { 33 | unsigned long cksm = 0; 34 | for (int i = 2; i < size - 2; i++) 35 | cksm += message[i]; 36 | cksm ^= 0xFFFF; 37 | message[size - 2] = (uint8_t)(cksm & 0xFF); 38 | message[size - 1] = (uint8_t)((cksm & 0xFF00) >> 8); 39 | } 40 | 41 | uint16_t proto_crc(const uint8_t *data, uint16_t size) { 42 | uint32_t calc = 0; 43 | uint16_t ret = 0; 44 | 45 | for (uint8_t index = 2; index < size - 2; index++) 46 | calc += data[index]; 47 | 48 | calc ^= 0xffff; 49 | ret |= (((uint8_t)(calc & 0xff)) << CRC0_SHIFT) & CRC0_MASK; 50 | ret |= (((uint8_t)((calc & 0xff00) >> 8)) << CRC1_SHIFT) & CRC1_MASK; 51 | 52 | return ret; 53 | } 54 | 55 | static uint8_t connected() { 56 | /* Some way to measure the timeout, in case connection dropped */ 57 | 58 | if (GET_TIME() - last_valid_message_time >= COMM_TIMEOUT) { 59 | /* Something happened, reset the connection */ 60 | return 0; 61 | } 62 | 63 | return 1; 64 | } 65 | 66 | static void print_stat() { 67 | printf("State \n"); 68 | printf("Tail: %hhu \n", stats.tail); 69 | printf("Eco: %hhu \n", stats.eco); 70 | printf("Led: %hhu \n", stats.led); 71 | printf("Night: %hhu \n", stats.night); 72 | printf("Beep: %hhu \n", stats.beep); 73 | printf("Eco: %hhu \n", stats.ecoMode); 74 | printf("Cruise: %hhu \n", stats.cruise); 75 | printf("Lock: %hhu \n", stats.lock); 76 | printf("Battery: %hhu \n", stats.battery); 77 | printf("Velocity: %hhu \n", stats.velocity); 78 | printf("AverageVelocity: %hhu \n", stats.averageVelocity); 79 | printf("Odometer: %hhu \n", stats.odometer); 80 | printf("Temperature: %hhu \n", stats.temperature); 81 | } 82 | 83 | static void process_command(const uint8_t *command, uint16_t size) { 84 | /* Verify crc */ 85 | if (!proto_verify_crc((uint8_t *)command, size)) 86 | return; 87 | 88 | /* Update last valid message */ 89 | last_valid_message_time = GET_TIME(); 90 | 91 | switch (command[3]) { 92 | case 0x21: 93 | switch (command[4]) { 94 | case 0x01: 95 | if (command[4] == 0x61) 96 | stats.tail = command[5]; 97 | break; 98 | case 0x64: 99 | stats.eco = command[6]; 100 | stats.led = command[7]; 101 | stats.night = command[8]; 102 | stats.beep = command[9]; 103 | break; 104 | } 105 | break; 106 | case 0x23: 107 | switch (command[5]) { 108 | case 0x7B: 109 | stats.ecoMode = command[6]; 110 | stats.cruise = command[8]; 111 | break; 112 | case 0x7D: 113 | stats.tail = command[6]; 114 | break; 115 | case 0xB0: 116 | stats.alarmStatus = command[8]; 117 | stats.lock = command[10]; 118 | stats.battery = command[14]; 119 | stats.velocity = (command[16] + (command[17] * 256)) / 1000 / PROTO_CONSTANT; 120 | stats.averageVelocity = (command[18] + (command[19] * 265)) / 1000 / PROTO_CONSTANT; 121 | stats.odometer = (command[20] + (command[21] * 256) + (command[22] * 256 * 256)) / 1000 / PROTO_CONSTANT; 122 | stats.temperature = ((command[28] + (command[29] * 256)) / 10 * 9 / 5) + 32; 123 | break; 124 | } 125 | } 126 | 127 | print_stat(); 128 | 129 | if (stats.beep == 1 && !stats.alarmStatus) { 130 | buzzer_default_beep(); 131 | } 132 | if(stats.beep == 2) { 133 | buzzer_default_beep(); 134 | stats.beep = 1; 135 | } 136 | else if(stats.beep == 3){ 137 | buzzer_default_beep(); 138 | stats.beep = 1; 139 | } 140 | 141 | if (stats.alarmStatus) { 142 | buzzer_default_beep(); 143 | stats.alarmStatus = 0; 144 | } 145 | } 146 | 147 | static void process_buffer(comm_chan *channel, QueueHandle_t display_queue) { 148 | /* 149 | * Hack to eliminate what it's send on tx 150 | * Start reading from rx buffer at position tx_size (suppose no packet was lost in tx) 151 | */ 152 | uint16_t buffer_size = channel->rx_size - channel->tx_size; 153 | uint8_t *buffer = channel->rx + channel->tx_size; 154 | 155 | if (buffer_size <= 0 || buffer_size > COMM_BUFF_SIZE) { 156 | /* Nothing to receive */ 157 | return; 158 | } 159 | 160 | /* Multiple commands in same buffer */ 161 | uint8_t *command_ptr = buffer; 162 | uint16_t command_size = 0; 163 | 164 | uint16_t command_no = 0; 165 | uint16_t index = 0; 166 | 167 | while (index < buffer_size) { 168 | if (index && 169 | buffer[index - 1] == PROTO_COMMAND_HEADER0 && 170 | buffer[index] == PROTO_COMMAND_HEADER1) { 171 | /* Command header detected */ 172 | if (command_no > 0) { 173 | /* If command_no is 0 it means that the header is for the first command */ 174 | command_size = index - 1 - command_size; 175 | process_command(command_ptr, command_size); 176 | command_ptr = buffer + index - 1; 177 | } 178 | command_no++; 179 | } else if (index == buffer_size - 1) { 180 | /* Process last packet */ 181 | command_size = index - command_size + 1; 182 | process_command(command_ptr, command_size); 183 | } 184 | index++; 185 | } 186 | } 187 | 188 | void proto_command(comm_chan *channel, QueueHandle_t display_queue) { 189 | static uint8_t messageType = 0; 190 | 191 | uint8_t brake = adc_brake(); 192 | uint8_t speed = adc_speed(); 193 | 194 | /* Process what's received and update the display */ 195 | process_buffer(channel, display_queue); 196 | 197 | if (!connected()) { 198 | printf("Not connected \n"); 199 | messageType = 4; 200 | } 201 | 202 | /* Iterate over all message types and collect informations */ 203 | switch (messageType++) { 204 | case 0: 205 | /* Write speed and brake */ 206 | case 1: 207 | /* Write speed and brake */ 208 | case 2: 209 | /* Write speed and brake */ 210 | case 3: { 211 | /* I don't know what this command does, seems to be the way to actually write the speed and brake values */ 212 | uint8_t command[] = {0x55, 0xAA, 0x7, 0x20, 0x65, 0x0, 0x4, speed, brake, 0x0, stats.beep, 0x0, 0x0}; 213 | proto_add_crc(command, sizeof(command)); 214 | comm_copy_tx_chan(channel, command, sizeof(command)); 215 | if (stats.beep) 216 | stats.beep = 0; 217 | break; 218 | } 219 | case 4: { 220 | uint8_t command[] = {0x55, 0xAA, 0x9, 0x20, 0x64, 0x0, 0x6, speed, brake, 0x0, stats.beep, 0x72, 0x0, 0x0, 0x0}; 221 | proto_add_crc(command, sizeof(command)); 222 | comm_copy_tx_chan(channel, command, sizeof(command)); 223 | if (stats.beep) 224 | stats.beep = 0; 225 | break; 226 | } 227 | case 5: { 228 | uint8_t command[] = {0x55, 0xAA, 0x6, 0x20, 0x61, 0xB0, 0x20, 0x02, speed, brake, 0x0, 0x0}; 229 | proto_add_crc(command, sizeof(command)); 230 | comm_copy_tx_chan(channel, command, sizeof(command)); 231 | break; 232 | } 233 | case 6: { 234 | uint8_t command[] = {0x55, 0xAA, 0x6, 0x20, 0x61, 0x7B, 0x4, 0x2, speed, brake, 0x0, 0x0}; 235 | proto_add_crc(command, sizeof(command)); 236 | comm_copy_tx_chan(channel, command, sizeof(command)); 237 | break; 238 | } 239 | case 7: { 240 | uint8_t command[] = {0x55, 0xAA, 0x6, 0x20, 0x61, 0x7D, 0x2, 0x2, speed, brake, 0x0, 0x0}; 241 | proto_add_crc(command, sizeof(command)); 242 | comm_copy_tx_chan(channel, command, sizeof(command)); 243 | messageType = 0; 244 | break; 245 | } 246 | } 247 | } 248 | -------------------------------------------------------------------------------- /components/display/display.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "freertos/FreeRTOS.h" 7 | #include "freertos/task.h" 8 | 9 | #include "tftspi.h" 10 | #include "tft.h" 11 | #include "driver/gpio.h" 12 | 13 | #include "display.h" 14 | 15 | #define SPI_BUS TFT_HSPI_HOST 16 | 17 | static struct tm *tm_info; 18 | static char tmp_buff[64]; 19 | static time_t time_now, time_last = 0; 20 | 21 | #define GDEMO_TIME 1000 22 | #define GDEMO_INFO_TIME 5000 23 | 24 | static void _checkTime() { 25 | time(&time_now); 26 | if (time_now > time_last) { 27 | color_t last_fg, last_bg; 28 | time_last = time_now; 29 | tm_info = localtime(&time_now); 30 | sprintf(tmp_buff, "%02d:%02d:%02d", tm_info->tm_hour, tm_info->tm_min, tm_info->tm_sec); 31 | 32 | TFT_saveClipWin(); 33 | TFT_resetclipwin(); 34 | 35 | Font curr_font = tft_cfont; 36 | last_bg = tft_bg; 37 | last_fg = tft_fg; 38 | tft_fg = TFT_YELLOW; 39 | tft_bg = (color_t){64, 64, 64}; 40 | TFT_setFont(DEFAULT_FONT, NULL); 41 | 42 | TFT_fillRect(1, tft_height - TFT_getfontheight() - 8, tft_width - 3, TFT_getfontheight() + 6, tft_bg); 43 | TFT_print(tmp_buff, CENTER, tft_height - TFT_getfontheight() - 5); 44 | 45 | tft_cfont = curr_font; 46 | tft_fg = last_fg; 47 | tft_bg = last_bg; 48 | 49 | TFT_restoreClipWin(); 50 | } 51 | } 52 | 53 | static int Wait(int ms) { 54 | uint8_t tm = 1; 55 | if (ms < 0) { 56 | tm = 0; 57 | ms *= -1; 58 | } 59 | if (ms <= 50) { 60 | vTaskDelay(ms / portTICK_RATE_MS); 61 | //if (_checkTouch()) return 0; 62 | } else { 63 | for (int n = 0; n < ms; n += 50) { 64 | vTaskDelay(50 / portTICK_RATE_MS); 65 | if (tm) 66 | _checkTime(); 67 | //if (_checkTouch()) return 0; 68 | } 69 | } 70 | return 1; 71 | } 72 | 73 | static unsigned int rand_interval(unsigned int min, unsigned int max) { 74 | int r; 75 | const unsigned int range = 1 + max - min; 76 | const unsigned int buckets = RAND_MAX / range; 77 | const unsigned int limit = buckets * range; 78 | 79 | /* Create equal size buckets all in a row, then fire randomly towards 80 | * the buckets until you land in one of them. All buckets are equally 81 | * likely. If you land off the end of the line of buckets, try again. */ 82 | do { 83 | r = rand(); 84 | } while (r >= limit); 85 | 86 | return min + (r / buckets); 87 | } 88 | 89 | static void _dispTime() { 90 | Font curr_font = tft_cfont; 91 | if (tft_width < 240) 92 | TFT_setFont(DEF_SMALL_FONT, NULL); 93 | else 94 | TFT_setFont(DEFAULT_FONT, NULL); 95 | 96 | time(&time_now); 97 | time_last = time_now; 98 | tm_info = localtime(&time_now); 99 | sprintf(tmp_buff, "%02d:%02d:%02d", tm_info->tm_hour, tm_info->tm_min, tm_info->tm_sec); 100 | TFT_print(tmp_buff, CENTER, tft_height - TFT_getfontheight() - 5); 101 | 102 | tft_cfont = curr_font; 103 | } 104 | 105 | static void disp_header(char *info) { 106 | TFT_fillScreen(TFT_BLACK); 107 | TFT_resetclipwin(); 108 | 109 | tft_fg = TFT_YELLOW; 110 | tft_bg = (color_t){64, 64, 64}; 111 | 112 | if (tft_width < 240) 113 | TFT_setFont(DEF_SMALL_FONT, NULL); 114 | else 115 | TFT_setFont(DEFAULT_FONT, NULL); 116 | TFT_fillRect(0, 0, tft_width - 1, TFT_getfontheight() + 8, tft_bg); 117 | TFT_drawRect(0, 0, tft_width - 1, TFT_getfontheight() + 8, TFT_CYAN); 118 | 119 | TFT_fillRect(0, tft_height - TFT_getfontheight() - 9, tft_width - 1, TFT_getfontheight() + 8, tft_bg); 120 | TFT_drawRect(0, tft_height - TFT_getfontheight() - 9, tft_width - 1, TFT_getfontheight() + 8, TFT_CYAN); 121 | 122 | TFT_print(info, CENTER, 4); 123 | _dispTime(); 124 | 125 | tft_bg = TFT_BLACK; 126 | TFT_setclipwin(0, TFT_getfontheight() + 9, tft_width - 1, tft_height - TFT_getfontheight() - 10); 127 | } 128 | 129 | static void update_header(char *hdr, char *ftr) { 130 | color_t last_fg, last_bg; 131 | 132 | TFT_saveClipWin(); 133 | TFT_resetclipwin(); 134 | 135 | Font curr_font = tft_cfont; 136 | last_bg = tft_bg; 137 | last_fg = tft_fg; 138 | tft_fg = TFT_YELLOW; 139 | tft_bg = (color_t){64, 64, 64}; 140 | if (tft_width < 240) 141 | TFT_setFont(DEF_SMALL_FONT, NULL); 142 | else 143 | TFT_setFont(DEFAULT_FONT, NULL); 144 | 145 | if (hdr) { 146 | TFT_fillRect(1, 1, tft_width - 3, TFT_getfontheight() + 6, tft_bg); 147 | TFT_print(hdr, CENTER, 4); 148 | } 149 | 150 | if (ftr) { 151 | TFT_fillRect(1, tft_height - TFT_getfontheight() - 8, tft_width - 3, TFT_getfontheight() + 6, tft_bg); 152 | if (strlen(ftr) == 0) 153 | _dispTime(); 154 | else 155 | TFT_print(ftr, CENTER, tft_height - TFT_getfontheight() - 5); 156 | } 157 | 158 | tft_cfont = curr_font; 159 | tft_fg = last_fg; 160 | tft_bg = last_bg; 161 | 162 | TFT_restoreClipWin(); 163 | } 164 | 165 | static color_t random_color() { 166 | color_t color; 167 | color.r = (uint8_t)rand_interval(8, 252); 168 | color.g = (uint8_t)rand_interval(8, 252); 169 | color.b = (uint8_t)rand_interval(8, 252); 170 | return color; 171 | } 172 | 173 | //--------------------- 174 | static void font_demo() { 175 | int x, y, n; 176 | uint32_t end_time; 177 | 178 | disp_header("FONT DEMO"); 179 | 180 | end_time = clock() + GDEMO_TIME; 181 | n = 0; 182 | while ((clock() < end_time) && (Wait(0))) { 183 | y = 4; 184 | for (int f = DEFAULT_FONT; f < FONT_7SEG; f++) { 185 | tft_fg = random_color(); 186 | TFT_setFont(f, NULL); 187 | TFT_print("Welcome to ESP32", 4, y); 188 | y += TFT_getfontheight() + 4; 189 | n++; 190 | } 191 | } 192 | sprintf(tmp_buff, "%d STRINGS", n); 193 | update_header(NULL, tmp_buff); 194 | Wait(-GDEMO_INFO_TIME); 195 | 196 | disp_header("ROTATED FONT DEMO"); 197 | 198 | end_time = clock() + GDEMO_TIME; 199 | n = 0; 200 | while ((clock() < end_time) && (Wait(0))) { 201 | for (int f = DEFAULT_FONT; f < FONT_7SEG; f++) { 202 | tft_fg = random_color(); 203 | TFT_setFont(f, NULL); 204 | x = rand_interval(8, tft_dispWin.x2 - 8); 205 | y = rand_interval(0, (tft_dispWin.y2 - tft_dispWin.y1) - TFT_getfontheight() - 2); 206 | tft_font_rotate = rand_interval(0, 359); 207 | 208 | TFT_print("Welcome to ESP32", x, y); 209 | n++; 210 | } 211 | } 212 | tft_font_rotate = 0; 213 | sprintf(tmp_buff, "%d STRINGS", n); 214 | update_header(NULL, tmp_buff); 215 | Wait(-GDEMO_INFO_TIME); 216 | 217 | disp_header("7-SEG FONT DEMO"); 218 | 219 | int ms = 0; 220 | int last_sec = 0; 221 | uint32_t ctime = clock(); 222 | end_time = clock() + GDEMO_TIME * 2; 223 | n = 0; 224 | while ((clock() < end_time) && (Wait(0))) { 225 | y = 12; 226 | ms = clock() - ctime; 227 | time(&time_now); 228 | tm_info = localtime(&time_now); 229 | if (tm_info->tm_sec != last_sec) { 230 | last_sec = tm_info->tm_sec; 231 | ms = 0; 232 | ctime = clock(); 233 | } 234 | 235 | tft_fg = TFT_ORANGE; 236 | sprintf(tmp_buff, "%02d:%02d:%03d", tm_info->tm_min, tm_info->tm_sec, ms); 237 | TFT_setFont(FONT_7SEG, NULL); 238 | if ((tft_width < 240) || (tft_height < 240)) 239 | set_7seg_font_atrib(8, 1, 1, TFT_DARKGREY); 240 | else 241 | set_7seg_font_atrib(12, 2, 1, TFT_DARKGREY); 242 | //TFT_clearStringRect(12, y, tmp_buff); 243 | TFT_print(tmp_buff, CENTER, y); 244 | n++; 245 | 246 | tft_fg = TFT_GREEN; 247 | y += TFT_getfontheight() + 12; 248 | if ((tft_width < 240) || (tft_height < 240)) 249 | set_7seg_font_atrib(9, 1, 1, TFT_DARKGREY); 250 | else 251 | set_7seg_font_atrib(14, 3, 1, TFT_DARKGREY); 252 | sprintf(tmp_buff, "%02d:%02d", tm_info->tm_sec, ms / 10); 253 | //TFT_clearStringRect(12, y, tmp_buff); 254 | TFT_print(tmp_buff, CENTER, y); 255 | n++; 256 | 257 | tft_fg = random_color(); 258 | y += TFT_getfontheight() + 8; 259 | set_7seg_font_atrib(6, 1, 1, TFT_DARKGREY); 260 | getFontCharacters((uint8_t *)tmp_buff); 261 | //TFT_clearStringRect(12, y, tmp_buff); 262 | TFT_print(tmp_buff, CENTER, y); 263 | n++; 264 | } 265 | sprintf(tmp_buff, "%d STRINGS", n); 266 | update_header(NULL, tmp_buff); 267 | Wait(-GDEMO_INFO_TIME); 268 | 269 | disp_header("WINDOW DEMO"); 270 | 271 | TFT_saveClipWin(); 272 | TFT_resetclipwin(); 273 | TFT_drawRect(38, 48, (tft_width * 3 / 4) - 36, (tft_height * 3 / 4) - 46, TFT_WHITE); 274 | TFT_setclipwin(40, 50, tft_width * 3 / 4, tft_height * 3 / 4); 275 | 276 | if ((tft_width < 240) || (tft_height < 240)) 277 | TFT_setFont(DEF_SMALL_FONT, NULL); 278 | else 279 | TFT_setFont(UBUNTU16_FONT, NULL); 280 | tft_text_wrap = 1; 281 | end_time = clock() + GDEMO_TIME; 282 | n = 0; 283 | while ((clock() < end_time) && (Wait(0))) { 284 | tft_fg = random_color(); 285 | TFT_print("This text is printed inside the window.\nLong line can be wrapped to the next line.\nWelcome to ESP32", 0, 0); 286 | n++; 287 | } 288 | tft_text_wrap = 0; 289 | sprintf(tmp_buff, "%d STRINGS", n); 290 | update_header(NULL, tmp_buff); 291 | Wait(-GDEMO_INFO_TIME); 292 | 293 | TFT_restoreClipWin(); 294 | } 295 | 296 | //--------------------- 297 | static void rect_demo() { 298 | int x, y, w, h, n; 299 | 300 | disp_header("RECTANGLE DEMO"); 301 | 302 | uint32_t end_time = clock() + GDEMO_TIME; 303 | n = 0; 304 | while ((clock() < end_time) && (Wait(0))) { 305 | x = rand_interval(4, tft_dispWin.x2 - 4); 306 | y = rand_interval(4, tft_dispWin.y2 - 2); 307 | w = rand_interval(2, tft_dispWin.x2 - x); 308 | h = rand_interval(2, tft_dispWin.y2 - y); 309 | TFT_drawRect(x, y, w, h, random_color()); 310 | n++; 311 | } 312 | sprintf(tmp_buff, "%d RECTANGLES", n); 313 | update_header(NULL, tmp_buff); 314 | Wait(-GDEMO_INFO_TIME); 315 | 316 | update_header("FILLED RECTANGLE", ""); 317 | TFT_fillWindow(TFT_BLACK); 318 | end_time = clock() + GDEMO_TIME; 319 | n = 0; 320 | while ((clock() < end_time) && (Wait(0))) { 321 | x = rand_interval(4, tft_dispWin.x2 - 4); 322 | y = rand_interval(4, tft_dispWin.y2 - 2); 323 | w = rand_interval(2, tft_dispWin.x2 - x); 324 | h = rand_interval(2, tft_dispWin.y2 - y); 325 | TFT_fillRect(x, y, w, h, random_color()); 326 | TFT_drawRect(x, y, w, h, random_color()); 327 | n++; 328 | } 329 | sprintf(tmp_buff, "%d RECTANGLES", n); 330 | update_header(NULL, tmp_buff); 331 | Wait(-GDEMO_INFO_TIME); 332 | } 333 | 334 | //---------------------- 335 | static void pixel_demo() { 336 | int x, y, n; 337 | 338 | disp_header("DRAW PIXEL DEMO"); 339 | 340 | uint32_t end_time = clock() + GDEMO_TIME; 341 | n = 0; 342 | while (1) { 343 | x = rand_interval(0, tft_dispWin.x2); 344 | y = rand_interval(0, tft_dispWin.y2); 345 | TFT_drawPixel(x, y, random_color(), 1); 346 | vTaskDelay(1); 347 | } 348 | sprintf(tmp_buff, "%d PIXELS", n); 349 | update_header(NULL, tmp_buff); 350 | Wait(-GDEMO_INFO_TIME); 351 | } 352 | 353 | //--------------------- 354 | static void line_demo() { 355 | int x1, y1, x2, y2, n; 356 | 357 | disp_header("LINE DEMO"); 358 | 359 | uint32_t end_time = clock() + GDEMO_TIME; 360 | n = 0; 361 | while ((clock() < end_time) && (Wait(0))) { 362 | x1 = rand_interval(0, tft_dispWin.x2); 363 | y1 = rand_interval(0, tft_dispWin.y2); 364 | x2 = rand_interval(0, tft_dispWin.x2); 365 | y2 = rand_interval(0, tft_dispWin.y2); 366 | TFT_drawLine(x1, y1, x2, y2, random_color()); 367 | n++; 368 | } 369 | sprintf(tmp_buff, "%d LINES", n); 370 | update_header(NULL, tmp_buff); 371 | Wait(-GDEMO_INFO_TIME); 372 | } 373 | 374 | //---------------------- 375 | static void aline_demo() { 376 | int x, y, len, angle, n; 377 | 378 | disp_header("LINE BY ANGLE DEMO"); 379 | 380 | x = (tft_dispWin.x2 - tft_dispWin.x1) / 2; 381 | y = (tft_dispWin.y2 - tft_dispWin.y1) / 2; 382 | if (x < y) 383 | len = x - 8; 384 | else 385 | len = y - 8; 386 | 387 | uint32_t end_time = clock() + GDEMO_TIME; 388 | n = 0; 389 | while ((clock() < end_time) && (Wait(0))) { 390 | for (angle = 0; angle < 360; angle++) { 391 | TFT_drawLineByAngle(x, y, 0, len, angle, random_color()); 392 | n++; 393 | } 394 | } 395 | 396 | TFT_fillWindow(TFT_BLACK); 397 | end_time = clock() + GDEMO_TIME; 398 | while ((clock() < end_time) && (Wait(0))) { 399 | for (angle = 0; angle < 360; angle++) { 400 | TFT_drawLineByAngle(x, y, len / 4, len / 4, angle, random_color()); 401 | n++; 402 | } 403 | for (angle = 0; angle < 360; angle++) { 404 | TFT_drawLineByAngle(x, y, len * 3 / 4, len / 4, angle, random_color()); 405 | n++; 406 | } 407 | } 408 | sprintf(tmp_buff, "%d LINES", n); 409 | update_header(NULL, tmp_buff); 410 | Wait(-GDEMO_INFO_TIME); 411 | } 412 | 413 | //-------------------- 414 | static void arc_demo() { 415 | uint16_t x, y, r, th, n, i; 416 | float start, end; 417 | color_t color, fillcolor; 418 | 419 | disp_header("ARC DEMO"); 420 | 421 | x = (tft_dispWin.x2 - tft_dispWin.x1) / 2; 422 | y = (tft_dispWin.y2 - tft_dispWin.y1) / 2; 423 | 424 | th = 6; 425 | uint32_t end_time = clock() + GDEMO_TIME; 426 | i = 0; 427 | while ((clock() < end_time) && (Wait(0))) { 428 | if (x < y) 429 | r = x - 4; 430 | else 431 | r = y - 4; 432 | start = 0; 433 | end = 20; 434 | n = 1; 435 | while (r > 10) { 436 | color = random_color(); 437 | TFT_drawArc(x, y, r, th, start, end, color, color); 438 | r -= (th + 2); 439 | n++; 440 | start += 30; 441 | end = start + (n * 20); 442 | i++; 443 | } 444 | } 445 | sprintf(tmp_buff, "%d ARCS", i); 446 | update_header(NULL, tmp_buff); 447 | Wait(-GDEMO_INFO_TIME); 448 | 449 | update_header("OUTLINED ARC", ""); 450 | TFT_fillWindow(TFT_BLACK); 451 | th = 8; 452 | end_time = clock() + GDEMO_TIME; 453 | i = 0; 454 | while ((clock() < end_time) && (Wait(0))) { 455 | if (x < y) 456 | r = x - 4; 457 | else 458 | r = y - 4; 459 | start = 0; 460 | end = 350; 461 | n = 1; 462 | while (r > 10) { 463 | color = random_color(); 464 | fillcolor = random_color(); 465 | TFT_drawArc(x, y, r, th, start, end, color, fillcolor); 466 | r -= (th + 2); 467 | n++; 468 | start += 20; 469 | end -= n * 10; 470 | i++; 471 | } 472 | } 473 | sprintf(tmp_buff, "%d ARCS", i); 474 | update_header(NULL, tmp_buff); 475 | Wait(-GDEMO_INFO_TIME); 476 | } 477 | 478 | //----------------------- 479 | static void circle_demo() { 480 | int x, y, r, n; 481 | 482 | disp_header("CIRCLE DEMO"); 483 | 484 | uint32_t end_time = clock() + GDEMO_TIME; 485 | n = 0; 486 | while ((clock() < end_time) && (Wait(0))) { 487 | x = rand_interval(8, tft_dispWin.x2 - 8); 488 | y = rand_interval(8, tft_dispWin.y2 - 8); 489 | if (x < y) 490 | r = rand_interval(2, x / 2); 491 | else 492 | r = rand_interval(2, y / 2); 493 | TFT_drawCircle(x, y, r, random_color()); 494 | n++; 495 | } 496 | sprintf(tmp_buff, "%d CIRCLES", n); 497 | update_header(NULL, tmp_buff); 498 | Wait(-GDEMO_INFO_TIME); 499 | 500 | update_header("FILLED CIRCLE", ""); 501 | TFT_fillWindow(TFT_BLACK); 502 | end_time = clock() + GDEMO_TIME; 503 | n = 0; 504 | while ((clock() < end_time) && (Wait(0))) { 505 | x = rand_interval(8, tft_dispWin.x2 - 8); 506 | y = rand_interval(8, tft_dispWin.y2 - 8); 507 | if (x < y) 508 | r = rand_interval(2, x / 2); 509 | else 510 | r = rand_interval(2, y / 2); 511 | TFT_fillCircle(x, y, r, random_color()); 512 | TFT_drawCircle(x, y, r, random_color()); 513 | n++; 514 | } 515 | sprintf(tmp_buff, "%d CIRCLES", n); 516 | update_header(NULL, tmp_buff); 517 | Wait(-GDEMO_INFO_TIME); 518 | } 519 | 520 | //------------------------ 521 | static void ellipse_demo() { 522 | int x, y, rx, ry, n; 523 | 524 | disp_header("ELLIPSE DEMO"); 525 | 526 | uint32_t end_time = clock() + GDEMO_TIME; 527 | n = 0; 528 | while ((clock() < end_time) && (Wait(0))) { 529 | x = rand_interval(8, tft_dispWin.x2 - 8); 530 | y = rand_interval(8, tft_dispWin.y2 - 8); 531 | if (x < y) 532 | rx = rand_interval(2, x / 4); 533 | else 534 | rx = rand_interval(2, y / 4); 535 | if (x < y) 536 | ry = rand_interval(2, x / 4); 537 | else 538 | ry = rand_interval(2, y / 4); 539 | TFT_drawEllipse(x, y, rx, ry, random_color(), 15); 540 | n++; 541 | } 542 | sprintf(tmp_buff, "%d ELLIPSES", n); 543 | update_header(NULL, tmp_buff); 544 | Wait(-GDEMO_INFO_TIME); 545 | 546 | update_header("FILLED ELLIPSE", ""); 547 | TFT_fillWindow(TFT_BLACK); 548 | end_time = clock() + GDEMO_TIME; 549 | n = 0; 550 | while ((clock() < end_time) && (Wait(0))) { 551 | x = rand_interval(8, tft_dispWin.x2 - 8); 552 | y = rand_interval(8, tft_dispWin.y2 - 8); 553 | if (x < y) 554 | rx = rand_interval(2, x / 4); 555 | else 556 | rx = rand_interval(2, y / 4); 557 | if (x < y) 558 | ry = rand_interval(2, x / 4); 559 | else 560 | ry = rand_interval(2, y / 4); 561 | TFT_fillEllipse(x, y, rx, ry, random_color(), 15); 562 | TFT_drawEllipse(x, y, rx, ry, random_color(), 15); 563 | n++; 564 | } 565 | sprintf(tmp_buff, "%d ELLIPSES", n); 566 | update_header(NULL, tmp_buff); 567 | Wait(-GDEMO_INFO_TIME); 568 | 569 | update_header("ELLIPSE SEGMENTS", ""); 570 | TFT_fillWindow(TFT_BLACK); 571 | end_time = clock() + GDEMO_TIME; 572 | n = 0; 573 | int k = 1; 574 | while ((clock() < end_time) && (Wait(0))) { 575 | x = rand_interval(8, tft_dispWin.x2 - 8); 576 | y = rand_interval(8, tft_dispWin.y2 - 8); 577 | if (x < y) 578 | rx = rand_interval(2, x / 4); 579 | else 580 | rx = rand_interval(2, y / 4); 581 | if (x < y) 582 | ry = rand_interval(2, x / 4); 583 | else 584 | ry = rand_interval(2, y / 4); 585 | TFT_fillEllipse(x, y, rx, ry, random_color(), (1 << k)); 586 | TFT_drawEllipse(x, y, rx, ry, random_color(), (1 << k)); 587 | k = (k + 1) & 3; 588 | n++; 589 | } 590 | sprintf(tmp_buff, "%d SEGMENTS", n); 591 | update_header(NULL, tmp_buff); 592 | Wait(-GDEMO_INFO_TIME); 593 | } 594 | 595 | //------------------------- 596 | static void triangle_demo() { 597 | int x1, y1, x2, y2, x3, y3, n; 598 | 599 | disp_header("TRIANGLE DEMO"); 600 | 601 | uint32_t end_time = clock() + GDEMO_TIME; 602 | n = 0; 603 | while ((clock() < end_time) && (Wait(0))) { 604 | x1 = rand_interval(4, tft_dispWin.x2 - 4); 605 | y1 = rand_interval(4, tft_dispWin.y2 - 2); 606 | x2 = rand_interval(4, tft_dispWin.x2 - 4); 607 | y2 = rand_interval(4, tft_dispWin.y2 - 2); 608 | x3 = rand_interval(4, tft_dispWin.x2 - 4); 609 | y3 = rand_interval(4, tft_dispWin.y2 - 2); 610 | TFT_drawTriangle(x1, y1, x2, y2, x3, y3, random_color()); 611 | n++; 612 | } 613 | sprintf(tmp_buff, "%d TRIANGLES", n); 614 | update_header(NULL, tmp_buff); 615 | Wait(-GDEMO_INFO_TIME); 616 | 617 | update_header("FILLED TRIANGLE", ""); 618 | TFT_fillWindow(TFT_BLACK); 619 | end_time = clock() + GDEMO_TIME; 620 | n = 0; 621 | while ((clock() < end_time) && (Wait(0))) { 622 | x1 = rand_interval(4, tft_dispWin.x2 - 4); 623 | y1 = rand_interval(4, tft_dispWin.y2 - 2); 624 | x2 = rand_interval(4, tft_dispWin.x2 - 4); 625 | y2 = rand_interval(4, tft_dispWin.y2 - 2); 626 | x3 = rand_interval(4, tft_dispWin.x2 - 4); 627 | y3 = rand_interval(4, tft_dispWin.y2 - 2); 628 | TFT_fillTriangle(x1, y1, x2, y2, x3, y3, random_color()); 629 | TFT_drawTriangle(x1, y1, x2, y2, x3, y3, random_color()); 630 | n++; 631 | } 632 | sprintf(tmp_buff, "%d TRIANGLES", n); 633 | update_header(NULL, tmp_buff); 634 | Wait(-GDEMO_INFO_TIME); 635 | } 636 | 637 | //--------------------- 638 | static void poly_demo() { 639 | uint16_t x, y, rot, oldrot; 640 | int i, n, r; 641 | uint8_t sides[6] = {3, 4, 5, 6, 8, 10}; 642 | color_t color[6] = {TFT_WHITE, TFT_CYAN, TFT_RED, TFT_BLUE, TFT_YELLOW, TFT_ORANGE}; 643 | color_t fill[6] = {TFT_BLUE, TFT_NAVY, TFT_DARKGREEN, TFT_DARKGREY, TFT_LIGHTGREY, TFT_OLIVE}; 644 | 645 | disp_header("POLYGON DEMO"); 646 | 647 | x = (tft_dispWin.x2 - tft_dispWin.x1) / 2; 648 | y = (tft_dispWin.y2 - tft_dispWin.y1) / 2; 649 | 650 | rot = 0; 651 | oldrot = 0; 652 | uint32_t end_time = clock() + GDEMO_TIME; 653 | n = 0; 654 | while ((clock() < end_time) && (Wait(0))) { 655 | if (x < y) 656 | r = x - 4; 657 | else 658 | r = y - 4; 659 | for (i = 5; i >= 0; i--) { 660 | TFT_drawPolygon(x, y, sides[i], r, TFT_BLACK, TFT_BLACK, oldrot, 1); 661 | TFT_drawPolygon(x, y, sides[i], r, color[i], color[i], rot, 1); 662 | r -= 16; 663 | if (r <= 0) { 664 | break; 665 | }; 666 | n += 2; 667 | } 668 | Wait(100); 669 | oldrot = rot; 670 | rot = (rot + 15) % 360; 671 | } 672 | sprintf(tmp_buff, "%d POLYGONS", n); 673 | update_header(NULL, tmp_buff); 674 | Wait(-GDEMO_INFO_TIME); 675 | 676 | update_header("FILLED POLYGON", ""); 677 | rot = 0; 678 | end_time = clock() + GDEMO_TIME; 679 | n = 0; 680 | while ((clock() < end_time) && (Wait(0))) { 681 | if (x < y) 682 | r = x - 4; 683 | else 684 | r = y - 4; 685 | TFT_fillWindow(TFT_BLACK); 686 | for (i = 5; i >= 0; i--) { 687 | TFT_drawPolygon(x, y, sides[i], r, color[i], fill[i], rot, 2); 688 | r -= 16; 689 | if (r <= 0) { 690 | break; 691 | } 692 | n += 2; 693 | } 694 | Wait(500); 695 | rot = (rot + 15) % 360; 696 | } 697 | sprintf(tmp_buff, "%d POLYGONS", n); 698 | update_header(NULL, tmp_buff); 699 | Wait(-GDEMO_INFO_TIME); 700 | } 701 | 702 | void display_refresh() { 703 | printf("pixel\n"); 704 | pixel_demo(); 705 | } 706 | 707 | void display_init() { 708 | esp_err_t ret; 709 | 710 | // === SET GLOBAL VARIABLES ========================== 711 | 712 | // =================================================== 713 | // ==== Set maximum spi clock for display read ==== 714 | // operations, function 'find_rd_speed()' ==== 715 | // can be used after display initialization ==== 716 | tft_max_rdclock = 1000000; 717 | // =================================================== 718 | 719 | // ==================================================================== 720 | // === Pins MUST be initialized before SPI interface initialization === 721 | // ==================================================================== 722 | TFT_PinsInit(); 723 | 724 | // ==== CONFIGURE SPI DEVICES(s) ==================================================================================== 725 | 726 | spi_lobo_device_handle_t spi; 727 | 728 | spi_lobo_bus_config_t buscfg = { 729 | .miso_io_num = PIN_NUM_MISO, // set SPI MISO pin 730 | .mosi_io_num = PIN_NUM_MOSI, // set SPI MOSI pin 731 | .sclk_io_num = PIN_NUM_CLK, // set SPI CLK pin 732 | .quadwp_io_num = -1, 733 | .quadhd_io_num = -1, 734 | .max_transfer_sz = 6 * 1024, 735 | }; 736 | spi_lobo_device_interface_config_t devcfg = { 737 | .clock_speed_hz = DEFAULT_SPI_CLOCK, // Initial clock out at 8 MHz 738 | .mode = 0, // SPI mode 0 739 | .spics_io_num = -1, // we will use external CS pin 740 | .spics_ext_io_num = PIN_NUM_CS, // external CS pin 741 | .flags = LB_SPI_DEVICE_HALFDUPLEX, // ALWAYS SET to HALF DUPLEX MODE!! for display spi 742 | }; 743 | 744 | ret = spi_lobo_bus_add_device(SPI_BUS, &buscfg, &devcfg, &spi); 745 | assert(ret == ESP_OK); 746 | tft_disp_spi = spi; 747 | 748 | // ==== Test select/deselect ==== 749 | ret = spi_lobo_device_select(spi, 1); 750 | assert(ret == ESP_OK); 751 | ret = spi_lobo_device_deselect(spi); 752 | assert(ret == ESP_OK); 753 | 754 | 755 | TFT_display_init(); 756 | 757 | tft_font_rotate = 0; 758 | tft_text_wrap = 0; 759 | tft_font_transparent = 0; 760 | tft_font_forceFixed = 0; 761 | tft_gray_scale = 0; 762 | TFT_setGammaCurve(DEFAULT_GAMMA_CURVE); 763 | TFT_setRotation(PORTRAIT_FLIP); 764 | TFT_invertDisplay(INVERT_ON); 765 | TFT_setFont(DEFAULT_FONT, NULL); 766 | TFT_resetclipwin(); 767 | } 768 | -------------------------------------------------------------------------------- /sdkconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Automatically generated file. DO NOT EDIT. 3 | # Espressif IoT Development Framework (ESP-IDF) Project Configuration 4 | # 5 | CONFIG_IDF_TARGET_ESP32=y 6 | CONFIG_IDF_TARGET="esp32" 7 | 8 | # 9 | # SDK tool configuration 10 | # 11 | CONFIG_SDK_TOOLPREFIX="xtensa-esp32-elf-" 12 | CONFIG_APP_COMPILE_TIME_DATE=y 13 | # CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set 14 | # CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set 15 | # CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set 16 | # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set 17 | # CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set 18 | CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y 19 | # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set 20 | # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set 21 | CONFIG_BOOTLOADER_LOG_LEVEL=3 22 | # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set 23 | CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y 24 | # CONFIG_BOOTLOADER_FACTORY_RESET is not set 25 | # CONFIG_BOOTLOADER_APP_TEST is not set 26 | CONFIG_BOOTLOADER_WDT_ENABLE=y 27 | # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set 28 | CONFIG_BOOTLOADER_WDT_TIME_MS=9000 29 | # CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set 30 | # CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set 31 | # CONFIG_SECURE_BOOT_ENABLED is not set 32 | # CONFIG_SECURE_FLASH_ENC_ENABLED is not set 33 | CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 34 | # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set 35 | # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set 36 | CONFIG_ESPTOOLPY_FLASHMODE_DIO=y 37 | # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set 38 | CONFIG_ESPTOOLPY_FLASHMODE="dio" 39 | # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set 40 | CONFIG_ESPTOOLPY_FLASHFREQ_40M=y 41 | # CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set 42 | # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set 43 | CONFIG_ESPTOOLPY_FLASHFREQ="40m" 44 | # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set 45 | CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y 46 | # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set 47 | # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set 48 | # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set 49 | CONFIG_ESPTOOLPY_FLASHSIZE="2MB" 50 | CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y 51 | CONFIG_ESPTOOLPY_BEFORE_RESET=y 52 | # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set 53 | CONFIG_ESPTOOLPY_BEFORE="default_reset" 54 | CONFIG_ESPTOOLPY_AFTER_RESET=y 55 | # CONFIG_ESPTOOLPY_AFTER_NORESET is not set 56 | CONFIG_ESPTOOLPY_AFTER="hard_reset" 57 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B is not set 58 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B is not set 59 | CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y 60 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B is not set 61 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B is not set 62 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB is not set 63 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER is not set 64 | CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL=115200 65 | CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 66 | CONFIG_PARTITION_TABLE_SINGLE_APP=y 67 | # CONFIG_PARTITION_TABLE_TWO_OTA is not set 68 | # CONFIG_PARTITION_TABLE_CUSTOM is not set 69 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 70 | CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" 71 | CONFIG_PARTITION_TABLE_OFFSET=0x8000 72 | CONFIG_PARTITION_TABLE_MD5=y 73 | CONFIG_M365_UART_DEVICE=0 74 | CONFIG_M365_UART_DEVICE0=y 75 | # CONFIG_M365_UART_DEVICE1 is not set 76 | # CONFIG_M365_UART_DEVICE2 is not set 77 | CONFIG_M365_BUFF_SIZE=128 78 | CONFIG_M365_TX_GPIO=1 79 | CONFIG_M365_RX_GPIO=3 80 | CONFIG_M365_TX_INTERVAL=50 81 | CONFIG_M365_RX_TIMEOUT=10 82 | CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y 83 | # CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set 84 | CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y 85 | # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set 86 | # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set 87 | # CONFIG_COMPILER_CXX_EXCEPTIONS is not set 88 | CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y 89 | # CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set 90 | # CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set 91 | # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set 92 | # CONFIG_COMPILER_STACK_CHECK is not set 93 | # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set 94 | # CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set 95 | # CONFIG_ESP32_APPTRACE_DEST_TRAX is not set 96 | CONFIG_ESP32_APPTRACE_DEST_NONE=y 97 | # CONFIG_ESP32_APPTRACE_ENABLE is not set 98 | CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y 99 | # CONFIG_BT_ENABLED is not set 100 | CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF=0 101 | CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=0 102 | CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF=0 103 | CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF=0 104 | CONFIG_BTDM_CTRL_PINNED_TO_CORE=0 105 | CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1 106 | CONFIG_BT_RESERVE_DRAM=0 107 | # CONFIG_ADC_FORCE_XPD_FSM is not set 108 | CONFIG_ADC_DISABLE_DAC=y 109 | # CONFIG_SPI_MASTER_IN_IRAM is not set 110 | CONFIG_SPI_MASTER_ISR_IN_IRAM=y 111 | # CONFIG_SPI_SLAVE_IN_IRAM is not set 112 | CONFIG_SPI_SLAVE_ISR_IN_IRAM=y 113 | # CONFIG_EFUSE_CUSTOM_TABLE is not set 114 | # CONFIG_EFUSE_VIRTUAL is not set 115 | # CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set 116 | CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y 117 | # CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set 118 | CONFIG_EFUSE_MAX_BLK_LEN=192 119 | # CONFIG_ESP_TLS_SERVER is not set 120 | CONFIG_ESP32_REV_MIN_0=y 121 | # CONFIG_ESP32_REV_MIN_1 is not set 122 | # CONFIG_ESP32_REV_MIN_2 is not set 123 | # CONFIG_ESP32_REV_MIN_3 is not set 124 | CONFIG_ESP32_REV_MIN=0 125 | CONFIG_ESP32_DPORT_WORKAROUND=y 126 | # CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set 127 | CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y 128 | # CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set 129 | CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 130 | # CONFIG_ESP32_SPIRAM_SUPPORT is not set 131 | # CONFIG_ESP32_MEMMAP_TRACEMEM is not set 132 | # CONFIG_ESP32_MEMMAP_TRACEMEM_TWOBANKS is not set 133 | # CONFIG_ESP32_TRAX is not set 134 | CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 135 | # CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set 136 | CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y 137 | CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 138 | # CONFIG_ESP32_ULP_COPROC_ENABLED is not set 139 | CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 140 | # CONFIG_ESP32_PANIC_PRINT_HALT is not set 141 | CONFIG_ESP32_PANIC_PRINT_REBOOT=y 142 | # CONFIG_ESP32_PANIC_SILENT_REBOOT is not set 143 | # CONFIG_ESP32_PANIC_GDBSTUB is not set 144 | CONFIG_ESP32_DEBUG_OCDAWARE=y 145 | CONFIG_ESP32_DEBUG_STUBS_ENABLE=y 146 | CONFIG_ESP32_BROWNOUT_DET=y 147 | CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y 148 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set 149 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set 150 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set 151 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set 152 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set 153 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set 154 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set 155 | CONFIG_ESP32_BROWNOUT_DET_LVL=0 156 | CONFIG_ESP32_REDUCE_PHY_TX_POWER=y 157 | CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y 158 | # CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set 159 | # CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set 160 | # CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set 161 | CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y 162 | # CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set 163 | # CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set 164 | # CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set 165 | CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 166 | CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 167 | CONFIG_ESP32_XTAL_FREQ_40=y 168 | # CONFIG_ESP32_XTAL_FREQ_26 is not set 169 | # CONFIG_ESP32_XTAL_FREQ_AUTO is not set 170 | CONFIG_ESP32_XTAL_FREQ=40 171 | # CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set 172 | # CONFIG_ESP32_NO_BLOBS is not set 173 | # CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set 174 | # CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set 175 | CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 176 | # CONFIG_PM_ENABLE is not set 177 | CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y 178 | CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y 179 | CONFIG_ADC_CAL_LUT_ENABLE=y 180 | # CONFIG_ESP_TIMER_PROFILING is not set 181 | CONFIG_ESP_ERR_TO_NAME_LOOKUP=y 182 | CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 183 | CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 184 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 185 | CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 186 | CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 187 | CONFIG_ESP_CONSOLE_UART_DEFAULT=y 188 | # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set 189 | # CONFIG_ESP_CONSOLE_UART_NONE is not set 190 | CONFIG_ESP_CONSOLE_UART_NUM=0 191 | CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 192 | CONFIG_ESP_INT_WDT=y 193 | CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 194 | CONFIG_ESP_INT_WDT_CHECK_CPU1=y 195 | CONFIG_ESP_TASK_WDT=y 196 | # CONFIG_ESP_TASK_WDT_PANIC is not set 197 | CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 198 | CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y 199 | CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y 200 | CONFIG_ETH_USE_ESP32_EMAC=y 201 | CONFIG_ETH_PHY_INTERFACE_RMII=y 202 | # CONFIG_ETH_PHY_INTERFACE_MII is not set 203 | CONFIG_ETH_RMII_CLK_INPUT=y 204 | # CONFIG_ETH_RMII_CLK_OUTPUT is not set 205 | CONFIG_ETH_RMII_CLK_IN_GPIO=0 206 | CONFIG_ETH_SMI_MDC_GPIO=23 207 | CONFIG_ETH_SMI_MDIO_GPIO=18 208 | CONFIG_ETH_PHY_USE_RST=y 209 | CONFIG_ETH_PHY_RST_GPIO=5 210 | CONFIG_ETH_DMA_BUFFER_SIZE=512 211 | CONFIG_ETH_DMA_RX_BUFFER_NUM=10 212 | CONFIG_ETH_DMA_TX_BUFFER_NUM=10 213 | CONFIG_ETH_USE_SPI_ETHERNET=y 214 | CONFIG_ETH_SPI_ETHERNET_DM9051=y 215 | CONFIG_ETH_DM9051_INT_GPIO=4 216 | # CONFIG_ESP_EVENT_LOOP_PROFILING is not set 217 | CONFIG_ESP_EVENT_POST_FROM_ISR=y 218 | CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y 219 | CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y 220 | # CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set 221 | CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 222 | CONFIG_HTTPD_MAX_URI_LEN=512 223 | CONFIG_HTTPD_ERR_RESP_NO_DELAY=y 224 | CONFIG_HTTPD_PURGE_BUF_LEN=32 225 | # CONFIG_HTTPD_LOG_PURGE_DATA is not set 226 | # CONFIG_OTA_ALLOW_HTTP is not set 227 | # CONFIG_ESP_HTTPS_SERVER_ENABLE is not set 228 | CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 229 | CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 230 | # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set 231 | CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y 232 | CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 233 | CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 234 | # CONFIG_ESP32_WIFI_CSI_ENABLED is not set 235 | CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y 236 | CONFIG_ESP32_WIFI_TX_BA_WIN=6 237 | CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y 238 | CONFIG_ESP32_WIFI_RX_BA_WIN=6 239 | CONFIG_ESP32_WIFI_NVS_ENABLED=y 240 | CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y 241 | # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set 242 | CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 243 | CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 244 | # CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE is not set 245 | CONFIG_ESP32_WIFI_IRAM_OPT=y 246 | CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y 247 | # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set 248 | CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 249 | CONFIG_ESP32_PHY_MAX_TX_POWER=20 250 | # CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set 251 | # CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set 252 | CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y 253 | # CONFIG_ESP32_ENABLE_COREDUMP is not set 254 | # CONFIG_FATFS_CODEPAGE_DYNAMIC is not set 255 | CONFIG_FATFS_CODEPAGE_437=y 256 | # CONFIG_FATFS_CODEPAGE_720 is not set 257 | # CONFIG_FATFS_CODEPAGE_737 is not set 258 | # CONFIG_FATFS_CODEPAGE_771 is not set 259 | # CONFIG_FATFS_CODEPAGE_775 is not set 260 | # CONFIG_FATFS_CODEPAGE_850 is not set 261 | # CONFIG_FATFS_CODEPAGE_852 is not set 262 | # CONFIG_FATFS_CODEPAGE_855 is not set 263 | # CONFIG_FATFS_CODEPAGE_857 is not set 264 | # CONFIG_FATFS_CODEPAGE_860 is not set 265 | # CONFIG_FATFS_CODEPAGE_861 is not set 266 | # CONFIG_FATFS_CODEPAGE_862 is not set 267 | # CONFIG_FATFS_CODEPAGE_863 is not set 268 | # CONFIG_FATFS_CODEPAGE_864 is not set 269 | # CONFIG_FATFS_CODEPAGE_865 is not set 270 | # CONFIG_FATFS_CODEPAGE_866 is not set 271 | # CONFIG_FATFS_CODEPAGE_869 is not set 272 | # CONFIG_FATFS_CODEPAGE_932 is not set 273 | # CONFIG_FATFS_CODEPAGE_936 is not set 274 | # CONFIG_FATFS_CODEPAGE_949 is not set 275 | # CONFIG_FATFS_CODEPAGE_950 is not set 276 | CONFIG_FATFS_CODEPAGE=437 277 | CONFIG_FATFS_LFN_NONE=y 278 | # CONFIG_FATFS_LFN_HEAP is not set 279 | # CONFIG_FATFS_LFN_STACK is not set 280 | CONFIG_FATFS_FS_LOCK=0 281 | CONFIG_FATFS_TIMEOUT_MS=10000 282 | CONFIG_FATFS_PER_FILE_CACHE=y 283 | CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150 284 | CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200 285 | CONFIG_FMB_QUEUE_LENGTH=20 286 | CONFIG_FMB_SERIAL_TASK_STACK_SIZE=2048 287 | CONFIG_FMB_SERIAL_BUF_SIZE=256 288 | CONFIG_FMB_SERIAL_TASK_PRIO=10 289 | # CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT is not set 290 | CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20 291 | CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 292 | CONFIG_FMB_CONTROLLER_STACK_SIZE=4096 293 | CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 294 | CONFIG_FMB_TIMER_PORT_ENABLED=y 295 | CONFIG_FMB_TIMER_GROUP=0 296 | CONFIG_FMB_TIMER_INDEX=0 297 | # CONFIG_FREERTOS_UNICORE is not set 298 | CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF 299 | CONFIG_FREERTOS_CORETIMER_0=y 300 | # CONFIG_FREERTOS_CORETIMER_1 is not set 301 | CONFIG_FREERTOS_HZ=100 302 | CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y 303 | # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set 304 | # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set 305 | CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y 306 | # CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set 307 | CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y 308 | CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 309 | CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y 310 | # CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set 311 | # CONFIG_FREERTOS_ASSERT_DISABLE is not set 312 | CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 313 | CONFIG_FREERTOS_ISR_STACKSIZE=1536 314 | # CONFIG_FREERTOS_LEGACY_HOOKS is not set 315 | CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 316 | # CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION is not set 317 | CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 318 | CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 319 | CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 320 | CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 321 | # CONFIG_FREERTOS_USE_TRACE_FACILITY is not set 322 | # CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set 323 | # CONFIG_FREERTOS_DEBUG_INTERNALS is not set 324 | CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y 325 | CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y 326 | # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set 327 | CONFIG_HEAP_POISONING_DISABLED=y 328 | # CONFIG_HEAP_POISONING_LIGHT is not set 329 | # CONFIG_HEAP_POISONING_COMPREHENSIVE is not set 330 | CONFIG_HEAP_TRACING_OFF=y 331 | # CONFIG_HEAP_TRACING_STANDALONE is not set 332 | # CONFIG_HEAP_TRACING_TOHOST is not set 333 | # CONFIG_HEAP_TRACING is not set 334 | CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y 335 | # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set 336 | # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set 337 | # CONFIG_LOG_DEFAULT_LEVEL_WARN is not set 338 | CONFIG_LOG_DEFAULT_LEVEL_INFO=y 339 | # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set 340 | # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set 341 | CONFIG_LOG_DEFAULT_LEVEL=3 342 | CONFIG_LOG_COLORS=y 343 | CONFIG_LWIP_LOCAL_HOSTNAME="espressif" 344 | # CONFIG_LWIP_L2_TO_L3_COPY is not set 345 | # CONFIG_LWIP_IRAM_OPTIMIZATION is not set 346 | CONFIG_LWIP_TIMERS_ONDEMAND=y 347 | CONFIG_LWIP_MAX_SOCKETS=10 348 | # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set 349 | CONFIG_LWIP_SO_REUSE=y 350 | CONFIG_LWIP_SO_REUSE_RXTOALL=y 351 | # CONFIG_LWIP_SO_RCVBUF is not set 352 | # CONFIG_LWIP_IP_FRAG is not set 353 | # CONFIG_LWIP_IP_REASSEMBLY is not set 354 | # CONFIG_LWIP_STATS is not set 355 | # CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set 356 | CONFIG_LWIP_ESP_GRATUITOUS_ARP=y 357 | CONFIG_LWIP_GARP_TMR_INTERVAL=60 358 | CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 359 | CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y 360 | # CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set 361 | CONFIG_LWIP_DHCPS_LEASE_UNIT=60 362 | CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 363 | # CONFIG_LWIP_AUTOIP is not set 364 | CONFIG_LWIP_NETIF_LOOPBACK=y 365 | CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 366 | CONFIG_LWIP_MAX_ACTIVE_TCP=16 367 | CONFIG_LWIP_MAX_LISTENING_TCP=16 368 | CONFIG_LWIP_TCP_MAXRTX=12 369 | CONFIG_LWIP_TCP_SYNMAXRTX=6 370 | CONFIG_LWIP_TCP_MSS=1440 371 | CONFIG_LWIP_TCP_MSL=60000 372 | CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 373 | CONFIG_LWIP_TCP_WND_DEFAULT=5744 374 | CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 375 | CONFIG_LWIP_TCP_QUEUE_OOSEQ=y 376 | # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set 377 | CONFIG_LWIP_TCP_OVERSIZE_MSS=y 378 | # CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set 379 | # CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set 380 | CONFIG_LWIP_MAX_UDP_PCBS=16 381 | CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 382 | CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 383 | CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y 384 | # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set 385 | # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set 386 | CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF 387 | # CONFIG_LWIP_PPP_SUPPORT is not set 388 | # CONFIG_LWIP_MULTICAST_PING is not set 389 | # CONFIG_LWIP_BROADCAST_PING is not set 390 | CONFIG_LWIP_MAX_RAW_PCBS=16 391 | CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1 392 | CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 393 | CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y 394 | # CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set 395 | # CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set 396 | CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=16384 397 | # CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN is not set 398 | # CONFIG_MBEDTLS_DEBUG is not set 399 | # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set 400 | # CONFIG_MBEDTLS_CMAC_C is not set 401 | CONFIG_MBEDTLS_HARDWARE_AES=y 402 | # CONFIG_MBEDTLS_HARDWARE_MPI is not set 403 | # CONFIG_MBEDTLS_HARDWARE_SHA is not set 404 | CONFIG_MBEDTLS_HAVE_TIME=y 405 | # CONFIG_MBEDTLS_HAVE_TIME_DATE is not set 406 | CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y 407 | # CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set 408 | # CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set 409 | # CONFIG_MBEDTLS_TLS_DISABLED is not set 410 | CONFIG_MBEDTLS_TLS_SERVER=y 411 | CONFIG_MBEDTLS_TLS_CLIENT=y 412 | CONFIG_MBEDTLS_TLS_ENABLED=y 413 | CONFIG_MBEDTLS_PSK_MODES=y 414 | CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y 415 | CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK=y 416 | CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK=y 417 | CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK=y 418 | CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y 419 | CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y 420 | CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y 421 | CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y 422 | CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y 423 | CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y 424 | CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y 425 | CONFIG_MBEDTLS_SSL_RENEGOTIATION=y 426 | # CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set 427 | CONFIG_MBEDTLS_SSL_PROTO_TLS1=y 428 | CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y 429 | CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y 430 | CONFIG_MBEDTLS_SSL_PROTO_DTLS=y 431 | CONFIG_MBEDTLS_SSL_ALPN=y 432 | CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y 433 | CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y 434 | CONFIG_MBEDTLS_AES_C=y 435 | # CONFIG_MBEDTLS_CAMELLIA_C is not set 436 | # CONFIG_MBEDTLS_DES_C is not set 437 | CONFIG_MBEDTLS_RC4_DISABLED=y 438 | # CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT is not set 439 | # CONFIG_MBEDTLS_RC4_ENABLED is not set 440 | # CONFIG_MBEDTLS_BLOWFISH_C is not set 441 | # CONFIG_MBEDTLS_XTEA_C is not set 442 | CONFIG_MBEDTLS_CCM_C=y 443 | CONFIG_MBEDTLS_GCM_C=y 444 | # CONFIG_MBEDTLS_RIPEMD160_C is not set 445 | CONFIG_MBEDTLS_PEM_PARSE_C=y 446 | CONFIG_MBEDTLS_PEM_WRITE_C=y 447 | CONFIG_MBEDTLS_X509_CRL_PARSE_C=y 448 | CONFIG_MBEDTLS_X509_CSR_PARSE_C=y 449 | CONFIG_MBEDTLS_ECP_C=y 450 | CONFIG_MBEDTLS_ECDH_C=y 451 | CONFIG_MBEDTLS_ECDSA_C=y 452 | CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y 453 | CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y 454 | CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y 455 | CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y 456 | CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y 457 | CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y 458 | CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y 459 | CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y 460 | CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y 461 | CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y 462 | CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y 463 | CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y 464 | CONFIG_MBEDTLS_ECP_NIST_OPTIM=y 465 | CONFIG_MDNS_MAX_SERVICES=10 466 | CONFIG_MQTT_PROTOCOL_311=y 467 | CONFIG_MQTT_TRANSPORT_SSL=y 468 | CONFIG_MQTT_TRANSPORT_WEBSOCKET=y 469 | CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y 470 | # CONFIG_MQTT_USE_CUSTOM_CONFIG is not set 471 | # CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set 472 | # CONFIG_MQTT_CUSTOM_OUTBOX is not set 473 | CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y 474 | # CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set 475 | # CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set 476 | # CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set 477 | # CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set 478 | CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y 479 | # CONFIG_NEWLIB_NANO_FORMAT is not set 480 | # CONFIG_OPENSSL_DEBUG is not set 481 | CONFIG_OPENSSL_ASSERT_DO_NOTHING=y 482 | # CONFIG_OPENSSL_ASSERT_EXIT is not set 483 | CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 484 | CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 485 | CONFIG_PTHREAD_STACK_MIN=768 486 | CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y 487 | # CONFIG_PTHREAD_DEFAULT_CORE_0 is not set 488 | # CONFIG_PTHREAD_DEFAULT_CORE_1 is not set 489 | CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 490 | CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" 491 | # CONFIG_SPI_FLASH_VERIFY_WRITE is not set 492 | # CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set 493 | CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y 494 | CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y 495 | # CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set 496 | # CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set 497 | # CONFIG_SPI_FLASH_USE_LEGACY_IMPL is not set 498 | CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y 499 | CONFIG_SPIFFS_BASE_ADDR=1048576 500 | CONFIG_SPIFFS_SIZE=1048576 501 | CONFIG_SPIFFS_LOG_BLOCK_SIZE=8192 502 | CONFIG_SPIFFS_LOG_PAGE_SIZE=256 503 | CONFIG_NETIF_IP_LOST_TIMER_INTERVAL=120 504 | CONFIG_TCPIP_LWIP=y 505 | CONFIG_UNITY_ENABLE_FLOAT=y 506 | CONFIG_UNITY_ENABLE_DOUBLE=y 507 | # CONFIG_UNITY_ENABLE_COLOR is not set 508 | CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y 509 | # CONFIG_UNITY_ENABLE_FIXTURE is not set 510 | # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set 511 | CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y 512 | CONFIG_VFS_SUPPORT_TERMIOS=y 513 | CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 514 | CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 515 | # CONFIG_WL_SECTOR_SIZE_512 is not set 516 | CONFIG_WL_SECTOR_SIZE_4096=y 517 | CONFIG_WL_SECTOR_SIZE=4096 518 | CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 519 | CONFIG_WPA_MBEDTLS_CRYPTO=y 520 | CONFIG_TFT_PREDEFINED_DISPLAY_TYPE=5 521 | # CONFIG_TFT_PREDEFINED_DISPLAY_TYPE0 is not set 522 | # CONFIG_TFT_PREDEFINED_DISPLAY_TYPE1 is not set 523 | # CONFIG_TFT_PREDEFINED_DISPLAY_TYPE4 is not set 524 | # CONFIG_TFT_PREDEFINED_DISPLAY_TYPE2 is not set 525 | # CONFIG_TFT_PREDEFINED_DISPLAY_TYPE3 is not set 526 | CONFIG_TFT_PREDEFINED_DISPLAY_TYPE5=y 527 | # CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set 528 | 529 | # Deprecated options for backward compatibility 530 | CONFIG_TOOLPREFIX="xtensa-esp32-elf-" 531 | # CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set 532 | # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set 533 | # CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set 534 | CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y 535 | # CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set 536 | # CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set 537 | CONFIG_LOG_BOOTLOADER_LEVEL=3 538 | # CONFIG_APP_ROLLBACK_ENABLE is not set 539 | # CONFIG_FLASH_ENCRYPTION_ENABLED is not set 540 | # CONFIG_FLASHMODE_QIO is not set 541 | # CONFIG_FLASHMODE_QOUT is not set 542 | CONFIG_FLASHMODE_DIO=y 543 | # CONFIG_FLASHMODE_DOUT is not set 544 | # CONFIG_MONITOR_BAUD_9600B is not set 545 | # CONFIG_MONITOR_BAUD_57600B is not set 546 | CONFIG_MONITOR_BAUD_115200B=y 547 | # CONFIG_MONITOR_BAUD_230400B is not set 548 | # CONFIG_MONITOR_BAUD_921600B is not set 549 | # CONFIG_MONITOR_BAUD_2MB is not set 550 | # CONFIG_MONITOR_BAUD_OTHER is not set 551 | CONFIG_MONITOR_BAUD_OTHER_VAL=115200 552 | CONFIG_MONITOR_BAUD=115200 553 | CONFIG_OPTIMIZATION_LEVEL_DEBUG=y 554 | # CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set 555 | CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y 556 | # CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set 557 | # CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set 558 | # CONFIG_CXX_EXCEPTIONS is not set 559 | CONFIG_STACK_CHECK_NONE=y 560 | # CONFIG_STACK_CHECK_NORM is not set 561 | # CONFIG_STACK_CHECK_STRONG is not set 562 | # CONFIG_STACK_CHECK_ALL is not set 563 | # CONFIG_STACK_CHECK is not set 564 | # CONFIG_WARN_WRITE_STRINGS is not set 565 | # CONFIG_DISABLE_GCC8_WARNINGS is not set 566 | CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=0 567 | CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=0 568 | CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0 569 | CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 570 | CONFIG_ADC2_DISABLE_DAC=y 571 | # CONFIG_SPIRAM_SUPPORT is not set 572 | # CONFIG_MEMMAP_TRACEMEM is not set 573 | # CONFIG_MEMMAP_TRACEMEM_TWOBANKS is not set 574 | CONFIG_TRACEMEM_RESERVE_DRAM=0x0 575 | # CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set 576 | CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y 577 | CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 578 | # CONFIG_ULP_COPROC_ENABLED is not set 579 | CONFIG_ULP_COPROC_RESERVE_MEM=0 580 | CONFIG_BROWNOUT_DET=y 581 | CONFIG_BROWNOUT_DET_LVL_SEL_0=y 582 | # CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set 583 | # CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set 584 | # CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set 585 | # CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set 586 | # CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set 587 | # CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set 588 | # CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set 589 | CONFIG_BROWNOUT_DET_LVL=0 590 | CONFIG_REDUCE_PHY_TX_POWER=y 591 | CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y 592 | # CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set 593 | # CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set 594 | # CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set 595 | # CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set 596 | # CONFIG_NO_BLOBS is not set 597 | # CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set 598 | CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 599 | CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 600 | CONFIG_MAIN_TASK_STACK_SIZE=3584 601 | CONFIG_IPC_TASK_STACK_SIZE=1024 602 | CONFIG_TIMER_TASK_STACK_SIZE=3584 603 | CONFIG_CONSOLE_UART_DEFAULT=y 604 | # CONFIG_CONSOLE_UART_CUSTOM is not set 605 | # CONFIG_CONSOLE_UART_NONE is not set 606 | CONFIG_CONSOLE_UART_NUM=0 607 | CONFIG_CONSOLE_UART_BAUDRATE=115200 608 | CONFIG_INT_WDT=y 609 | CONFIG_INT_WDT_TIMEOUT_MS=300 610 | CONFIG_INT_WDT_CHECK_CPU1=y 611 | CONFIG_TASK_WDT=y 612 | # CONFIG_TASK_WDT_PANIC is not set 613 | CONFIG_TASK_WDT_TIMEOUT_S=5 614 | CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y 615 | CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y 616 | # CONFIG_EVENT_LOOP_PROFILING is not set 617 | CONFIG_POST_EVENTS_FROM_ISR=y 618 | CONFIG_POST_EVENTS_FROM_IRAM_ISR=y 619 | CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 620 | CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 621 | CONFIG_MB_QUEUE_LENGTH=20 622 | CONFIG_MB_SERIAL_TASK_STACK_SIZE=2048 623 | CONFIG_MB_SERIAL_BUF_SIZE=256 624 | CONFIG_MB_SERIAL_TASK_PRIO=10 625 | # CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT is not set 626 | CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 627 | CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 628 | CONFIG_MB_CONTROLLER_STACK_SIZE=4096 629 | CONFIG_MB_EVENT_QUEUE_TIMEOUT=20 630 | CONFIG_MB_TIMER_PORT_ENABLED=y 631 | CONFIG_MB_TIMER_GROUP=0 632 | CONFIG_MB_TIMER_INDEX=0 633 | # CONFIG_SUPPORT_STATIC_ALLOCATION is not set 634 | CONFIG_TIMER_TASK_PRIORITY=1 635 | CONFIG_TIMER_TASK_STACK_DEPTH=2048 636 | CONFIG_TIMER_QUEUE_LENGTH=10 637 | # CONFIG_L2_TO_L3_COPY is not set 638 | # CONFIG_USE_ONLY_LWIP_SELECT is not set 639 | CONFIG_ESP_GRATUITOUS_ARP=y 640 | CONFIG_GARP_TMR_INTERVAL=60 641 | CONFIG_TCPIP_RECVMBOX_SIZE=32 642 | CONFIG_TCP_MAXRTX=12 643 | CONFIG_TCP_SYNMAXRTX=6 644 | CONFIG_TCP_MSS=1440 645 | CONFIG_TCP_MSL=60000 646 | CONFIG_TCP_SND_BUF_DEFAULT=5744 647 | CONFIG_TCP_WND_DEFAULT=5744 648 | CONFIG_TCP_RECVMBOX_SIZE=6 649 | CONFIG_TCP_QUEUE_OOSEQ=y 650 | # CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set 651 | CONFIG_TCP_OVERSIZE_MSS=y 652 | # CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set 653 | # CONFIG_TCP_OVERSIZE_DISABLE is not set 654 | CONFIG_UDP_RECVMBOX_SIZE=6 655 | CONFIG_TCPIP_TASK_STACK_SIZE=3072 656 | CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y 657 | # CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set 658 | # CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set 659 | CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF 660 | # CONFIG_PPP_SUPPORT is not set 661 | CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 662 | CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 663 | CONFIG_ESP32_PTHREAD_STACK_MIN=768 664 | CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y 665 | # CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set 666 | # CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set 667 | CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 668 | CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" 669 | CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y 670 | # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set 671 | # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set 672 | CONFIG_IP_LOST_TIMER_INTERVAL=120 673 | CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y 674 | CONFIG_SUPPORT_TERMIOS=y 675 | # End of deprecated options 676 | --------------------------------------------------------------------------------