Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f694c0b
add blind spot
parahybaja-punchClock Jan 22, 2024
ad74cf3
Modify in process
parahybaja-punchClock Jan 24, 2024
16bdb57
add project IDE
Flaviano-Junior Jan 29, 2024
566c1f1
Insert project for accelerometer
Flaviano-Junior Feb 22, 2024
51cef18
Delete project test_i2c
Flaviano-Junior Feb 23, 2024
1494caa
add PCNT fisrt version
Jefferson-Lopes Mar 8, 2024
5c74f4a
move speedometer to component
Jefferson-Lopes Mar 8, 2024
b66e057
create RPM task
Jefferson-Lopes Mar 8, 2024
c776614
fix MPU upside down mounting
Jefferson-Lopes Mar 17, 2024
0e19337
fix read queue overflow
Jefferson-Lopes Mar 18, 2024
071554b
fix variable type bug and add pcnt protection
Jefferson-Lopes Mar 18, 2024
a29020e
add more space to tasks
Jefferson-Lopes Mar 18, 2024
11f71ba
add calibration and offset
Jefferson-Lopes Mar 19, 2024
4be6f30
call MPU calibration
Jefferson-Lopes Mar 20, 2024
16d0139
update calculo
Vitorluca Jun 26, 2024
f72fd1e
Inserted cod of 4x4
Flaviano-Junior Aug 2, 2024
f265707
update nextion variables
marilira Sep 19, 2024
5aa8633
remove dark page
marilira Sep 19, 2024
0c98798
add enduro touch event
marilira Sep 19, 2024
c92d88e
add timer nextion configs
marilira Sep 19, 2024
b76d1ec
add enduro page functionalities
marilira Sep 19, 2024
779fc24
developed timer
parahybaja-punchClock Sep 23, 2024
1f18b83
Merge remote-tracking branch 'upstream/develop-timer' into develop-ma
parahybaja-punchClock Sep 23, 2024
3e2b086
refactoring
parahybaja-punchClock Sep 24, 2024
83ca8e9
refactoring 2
parahybaja-punchClock Sep 24, 2024
f2236e4
timer padding addded
parahybaja-punchClock Sep 24, 2024
32d8299
changed timer to decrement
parahybaja-punchClock Sep 24, 2024
0853c80
define more nextion variables
marilira Sep 24, 2024
8b6eef6
add lap functions
marilira Sep 24, 2024
c6eece6
fix lap variables
marilira Sep 24, 2024
82cd2b7
monitoring task creat
Raynoan-emilly Sep 25, 2024
668b30a
Add a 4x4 in system
Raynoan-emilly Sep 25, 2024
bd31a11
4x4 ativing and desativing add at the system
Raynoan-emilly Sep 25, 2024
56b415e
Merge remote-tracking branch 'origin/develop-ma' into develop-flav
Raynoan-emilly Sep 25, 2024
d65fc77
changes for 4x4 and qh lap of timer
Raynoan-emilly Sep 25, 2024
f7fdec1
add dynamics radios to speeedometer
Raynoan-emilly Sep 25, 2024
7389ed1
add names and versions of the code
Raynoan-emilly Sep 25, 2024
4280897
Add infrared value
Raynoan-emilly Sep 26, 2024
9621ad8
add changes main
Raynoan-emilly Sep 26, 2024
f8c0788
changed button ids and esp-idf version
Raynoan-emilly Sep 27, 2024
f5db74e
Merge pull request #23 from Parahybaja/develop-blind_spot
Raynoan-emilly Jan 31, 2025
7cb9686
Merge pull request #24 from Parahybaja/develop-flav
Raynoan-emilly Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions ECU_front/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
* Version Modified By Date Comments
* ------- ------------- ---------- -----------
* 5.0.0 Jefferson L. 15/01/2024 convertion to esp-idf
*
* 5.0.1 Luiz 24/09/2024 add timer task
* 5.0.1 Raynoan E. 25/09/2024 add infrared task
*/

#include <stdio.h>
Expand All @@ -21,13 +22,17 @@
#include "task/display.h"
#include "task/rollover.h"
#include "task/task_example.h"
#include "task/infrared.h"
#include "task/timer.h"

#include "espnow_callback.h"

static const char* TAG = "ECU_front";

static const gpio_num_t alive_pin = GPIO_NUM_12;

static const uint8_t mpu_calibrate = false;

/* LoRa preamble */
static const int cr = 8; // coding rate
static const int sbw = 3; // signal bandwidth
Expand Down Expand Up @@ -77,12 +82,31 @@ void app_main(void) {
);

xTaskCreatePinnedToCore(
task_rollover, // task function
"rollover", // task name
4096, // stack size
NULL, // parameters
8, // priority
&th_rollover, // handler
APP_CPU_NUM // core number
task_rollover, // task function
"rollover", // task name
4096, // stack size
(void*)mpu_calibrate, // parameters
8, // priority
&th_rollover, // handler
APP_CPU_NUM // core number
);

xTaskCreatePinnedToCore(
task_timer, // task function
"timer", // task name
2048, // stack size
NULL, // parameters
8, // priority
&th_timer, // handler
APP_CPU_NUM // core number
);

xTaskCreatePinnedToCore(
task_infrared, // task function
"infrared", // task name
2048, // stack size
NULL, // parameters
8, // priority
&th_infrared, // handler
APP_CPU_NUM); // core number
}
59 changes: 44 additions & 15 deletions ECU_front/sdkconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Automatically generated file. DO NOT EDIT.
# Espressif IoT Development Framework (ESP-IDF) 5.1.2 Project Configuration
# Espressif IoT Development Framework (ESP-IDF) 5.1.4 Project Configuration
#
CONFIG_SOC_BROWNOUT_RESET_SUPPORTED="Not determined"
CONFIG_SOC_TWAI_BRP_DIV_SUPPORTED="Not determined"
Expand Down Expand Up @@ -248,6 +248,14 @@ CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set
# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set
CONFIG_BOOTLOADER_LOG_LEVEL=3

#
# Serial Flash Configurations
#
# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set
CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y
# end of Serial Flash Configurations

# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set
CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y
# CONFIG_BOOTLOADER_FACTORY_RESET is not set
Expand All @@ -262,7 +270,6 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000
# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set
CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0
# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set
CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y
# end of Bootloader config

#
Expand Down Expand Up @@ -668,7 +675,9 @@ CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y
CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y
# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set
CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=2000
# CONFIG_ESP_SLEEP_DEBUG is not set
CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y
# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set
# end of Sleep Config

#
Expand Down Expand Up @@ -742,6 +751,7 @@ CONFIG_ESP_PHY_RF_CAL_PARTIAL=y
# CONFIG_ESP_PHY_RF_CAL_NONE is not set
# CONFIG_ESP_PHY_RF_CAL_FULL is not set
CONFIG_ESP_PHY_CALIBRATION_MODE=0
# CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set
# end of PHY

#
Expand Down Expand Up @@ -932,6 +942,7 @@ CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y
# CONFIG_ESP_WIFI_DEBUG_PRINT is not set
# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set
CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y
# CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER is not set
# end of Wi-Fi

#
Expand Down Expand Up @@ -1025,7 +1036,7 @@ CONFIG_FREERTOS_CORETIMER_0=y
# CONFIG_FREERTOS_CORETIMER_1 is not set
CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y
# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set
# CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set
CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y
# end of Port
Expand Down Expand Up @@ -1213,6 +1224,13 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=1
CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000
# end of SNTP

#
# DNS
#
CONFIG_LWIP_DNS_MAX_SERVERS=3
# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set
# end of DNS

CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7
CONFIG_LWIP_ESP_LWIP_ASSERT=y

Expand Down Expand Up @@ -1279,6 +1297,7 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200
# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set
CONFIG_MBEDTLS_CMAC_C=y
CONFIG_MBEDTLS_HARDWARE_AES=y
CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER=y
CONFIG_MBEDTLS_HARDWARE_MPI=y
CONFIG_MBEDTLS_HARDWARE_SHA=y
CONFIG_MBEDTLS_ROM_MD5=y
Expand Down Expand Up @@ -1424,6 +1443,7 @@ CONFIG_OPENTHREAD_NETWORK_PSKC="104810e2315100afd6bc9215a6bfac53"

CONFIG_OPENTHREAD_XTAL_ACCURACY=130
# CONFIG_OPENTHREAD_SPINEL_ONLY is not set
CONFIG_OPENTHREAD_RX_ON_WHEN_IDLE=y

#
# Thread Address Query Config
Expand Down Expand Up @@ -1460,6 +1480,27 @@ CONFIG_MMU_PAGE_MODE="64KB"
CONFIG_MMU_PAGE_SIZE=0x10000
# end of MMU Config

#
# Main Flash configuration
#

#
# SPI Flash behavior when brownout
#
CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y
CONFIG_SPI_FLASH_BROWNOUT_RESET=y
# end of SPI Flash behavior when brownout

#
# Optional and Experimental Features (READ DOCS FIRST)
#

#
# Features here require specific hardware (READ DOCS FIRST!)
#
# end of Optional and Experimental Features (READ DOCS FIRST)
# end of Main Flash configuration

#
# SPI Flash driver
#
Expand All @@ -1479,13 +1520,6 @@ CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192
# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set
# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set

#
# SPI Flash behavior when brownout
#
CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y
CONFIG_SPI_FLASH_BROWNOUT_RESET=y
# end of SPI Flash behavior when brownout

#
# Auto-detect flash chips
#
Expand Down Expand Up @@ -1572,11 +1606,6 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set
# end of Unity unit testing library

#
# Root Hub configuration
#
# end of Root Hub configuration

#
# Virtual file system
#
Expand Down
24 changes: 24 additions & 0 deletions ECU_rear/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@

#include <stdio.h>
#include "system.h"
#include "task/rpm.h"
#include "task/alive.h"
#include "task/battery.h"
#include "task/speedometer.h"
// #include "task/fuel_em.h"

#include "espnow_callback.h"

static const char *TAG = "ECU_rear";

static const gpio_num_t rpm_pin = GPIO_NUM_36;
static const gpio_num_t speed_pin = GPIO_NUM_39;
static const gpio_num_t alive_pin = GPIO_NUM_2;
// static const gpio_num_t fuel_em_pin = GPIO_NUM_34;
static const battery_config_t battery_config = {
Expand Down Expand Up @@ -71,4 +75,24 @@ void app_main(void) {
// &th_fuel_em, // handler
// APP_CPU_NUM // core number
// );

xTaskCreatePinnedToCore(
task_speed, // task function
"speed", // task name
4096, // stack size
(void*)speed_pin, // parameters
10, // priority
&th_speed, // handler
APP_CPU_NUM // core number
);

xTaskCreatePinnedToCore(
task_rpm, // task function
"RPM", // task name
4096, // stack size
(void*)rpm_pin, // parameters
10, // priority
&th_rpm, // handler
APP_CPU_NUM // core number
);
}
Loading