2021-10-27 05:06:41 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_DIY
|
|
|
|
#include "esp32diy.h" // Charles
|
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_BUZZ
|
|
|
|
#include "esp32buzz.h" //Buzz
|
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_ICARUS
|
|
|
|
#include "esp32icarus.h" //Alex
|
2022-11-30 05:59:45 -04:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_EMPTY
|
|
|
|
#include "esp32empty.h" //wiktor-m
|
2023-05-01 20:27:32 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_TOMTE76
|
|
|
|
#include "esp32tomte76.h" //tomte76 on discord
|
2023-05-13 20:52:41 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_NICK
|
|
|
|
#include "esp32nick.h" //Nick K. on discord
|
2023-05-15 13:50:33 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_S3DEVKIT
|
|
|
|
#include "esp32s3devkit.h" //Nick K. on discord
|
2023-12-29 02:21:43 -04:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_S3EMPTY
|
|
|
|
#include "esp32s3empty.h"
|
|
|
|
#else
|
|
|
|
#error "Invalid CONFIG_HAL_BOARD_SUBTYPE for esp32"
|
2021-10-27 05:06:41 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define HAL_BOARD_NAME "ESP32"
|
|
|
|
#define HAL_CPU_CLASS HAL_CPU_CLASS_150
|
2023-04-08 01:09:10 -03:00
|
|
|
#define HAL_WITH_DRONECAN 0
|
2023-05-01 20:29:44 -03:00
|
|
|
#define HAL_WITH_UAVCAN 0
|
|
|
|
#define HAL_MAX_CAN_PROTOCOL_DRIVERS 0
|
2021-10-27 05:06:41 -03:00
|
|
|
#define HAL_HAVE_SAFETY_SWITCH 0
|
|
|
|
#define HAL_HAVE_BOARD_VOLTAGE 0
|
|
|
|
#define HAL_HAVE_SERVO_VOLTAGE 0
|
|
|
|
|
|
|
|
#define HAL_WITH_IO_MCU 0
|
|
|
|
|
|
|
|
#define O_CLOEXEC 0
|
|
|
|
#define HAL_STORAGE_SIZE (16384)
|
|
|
|
|
2023-03-09 18:43:42 -04:00
|
|
|
#ifdef __cplusplus
|
2021-10-27 05:06:41 -03:00
|
|
|
// allow for static semaphores
|
|
|
|
#include <AP_HAL_ESP32/Semaphores.h>
|
|
|
|
#define HAL_Semaphore ESP32::Semaphore
|
2023-12-29 17:29:46 -04:00
|
|
|
#define HAL_BinarySemaphore ESP32::BinarySemaphore
|
2023-03-09 18:43:42 -04:00
|
|
|
#endif
|
2021-10-27 05:06:41 -03:00
|
|
|
|
|
|
|
#define HAL_NUM_CAN_IFACES 0
|
|
|
|
#define HAL_MEM_CLASS HAL_MEM_CLASS_192
|
|
|
|
|
2023-05-01 20:29:44 -03:00
|
|
|
// disable uncommon stuff that we'd otherwise get
|
|
|
|
#define HAL_EXTERNAL_AHRS_ENABLED 0
|
|
|
|
#define HAL_GENERATOR_ENABLED 0
|
2021-10-27 05:06:41 -03:00
|
|
|
|
|
|
|
#define __LITTLE_ENDIAN 1234
|
|
|
|
#define __BYTE_ORDER __LITTLE_ENDIAN
|
|
|
|
|
2024-08-12 23:54:21 -03:00
|
|
|
// ArduPilot uses __RAMFUNC__ to place functions in fast instruction RAM
|
|
|
|
#define __RAMFUNC__ IRAM_ATTR
|
|
|
|
|
|
|
|
|
2021-10-27 05:06:41 -03:00
|
|
|
// whenver u get ... error: "xxxxxxx" is not defined, evaluates to 0 [-Werror=undef] just define it below as 0
|
|
|
|
#define CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY 0
|
|
|
|
#define XCHAL_ERRATUM_453 0
|
2023-05-15 13:47:38 -03:00
|
|
|
//#define CONFIG_FREERTOS_CORETIMER_0 0
|
2021-10-27 05:06:41 -03:00
|
|
|
#define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE 0
|
|
|
|
#define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL 0
|
|
|
|
#define CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP 0
|
|
|
|
#define CONFIG_FREERTOS_USE_TICKLESS_IDLE 0
|
|
|
|
#define CONFIG_SYSVIEW_ENABLE 0
|
|
|
|
#define CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED 0
|
|
|
|
#define CONFIG_SPI_FLASH_ENABLE_COUNTERS 0
|
|
|
|
#define USE_LIBC_REALLOC 0
|
|
|
|
#define CONFIG_LWIP_DHCP_RESTORE_LAST_IP 0
|
|
|
|
#define CONFIG_LWIP_STATS 0
|
|
|
|
#define CONFIG_LWIP_PPP_SUPPORT 0
|
|
|
|
#define CONFIG_LWIP_STATS 0
|
2023-05-15 13:47:38 -03:00
|
|
|
//#define CONFIG_ESP32_WIFI_CSI_ENABLED 0
|
|
|
|
//#define CONFIG_ESP32_WIFI_NVS_ENABLED 0
|
2021-10-27 05:06:41 -03:00
|
|
|
#define CONFIG_NEWLIB_NANO_FORMAT 0
|
|
|
|
#define CONFIG_LWIP_IP4_REASSEMBLY 0
|
|
|
|
#define CONFIG_LWIP_IP6_REASSEMBLY 0
|
|
|
|
#define CONFIG_LWIP_STATS 0
|
|
|
|
#define LWIP_COMPAT_SOCKET_INET 0
|
|
|
|
#define LWIP_COMPAT_SOCKET_ADDR 0
|
2023-05-15 13:47:38 -03:00
|
|
|
//#define CONFIG_ESP32_WIFI_TX_BA_WIN 0
|
|
|
|
//#define CONFIG_ESP32_WIFI_RX_BA_WIN 0
|
2021-10-27 05:06:41 -03:00
|
|
|
|
2023-05-01 20:29:44 -03:00
|
|
|
|
|
|
|
// turn off all the compasses by default..
|
|
|
|
#ifndef AP_COMPASS_BACKEND_DEFAULT_ENABLED
|
|
|
|
#define AP_COMPASS_BACKEND_DEFAULT_ENABLED 0
|
|
|
|
#endif
|
|
|
|
|
2023-05-01 20:52:16 -03:00
|
|
|
// we don't need 32, 16 is enough
|
|
|
|
#define NUM_SERVO_CHANNELS 16
|
|
|
|
|
2023-05-01 20:29:44 -03:00
|
|
|
// disble temp cal of gyros by default
|
|
|
|
#define HAL_INS_TEMPERATURE_CAL_ENABLE 0
|
|
|
|
|
|
|
|
//turn off a bunch of advanced plane scheduler table things. see ArduPlane.cpp
|
|
|
|
#define AP_ADVANCEDFAILSAFE_ENABLED 0
|
|
|
|
#define AP_ICENGINE_ENABLED 0
|
|
|
|
#define AP_OPTICALFLOW_ENABLED 0
|
|
|
|
#define AP_RPM_ENABLED 0
|
|
|
|
#define AP_AIRSPEED_AUTOCAL_ENABLE 0
|
|
|
|
#define HAL_MOUNT_ENABLED 0
|
|
|
|
#define AP_CAMERA_ENABLED 0
|
|
|
|
#define HAL_SOARING_ENABLED 0
|
|
|
|
#define AP_TERRAIN_AVAILABLE 0
|
|
|
|
#define HAL_ADSB_ENABLED 0
|
|
|
|
#define HAL_BUTTON_ENABLED 0
|
|
|
|
#define AP_GRIPPER_ENABLED 0
|
|
|
|
#define AP_LANDINGGEAR_ENABLED 0
|
|
|
|
|
|
|
|
// disable avoid-fence-follow in copter, these all kinda need each other, so its all or none.
|
2024-03-08 22:35:25 -04:00
|
|
|
#define AP_AVOIDANCE_ENABLED 0
|
2023-05-01 20:29:44 -03:00
|
|
|
#define AP_FENCE_ENABLED 0
|
|
|
|
#define MODE_FOLLOW_ENABLED 0
|
2024-03-08 22:35:25 -04:00
|
|
|
#define AP_OAPATHPLANNER_ENABLED 0
|
2023-05-01 20:29:44 -03:00
|
|
|
|
|
|
|
|
|
|
|
// other big things..
|
|
|
|
#define HAL_QUADPLANE_ENABLED 0
|
2023-12-29 17:29:46 -04:00
|
|
|
#define HAL_GYROFFT_ENABLED 0
|
2024-08-31 17:10:58 -03:00
|
|
|
|
|
|
|
// remove once ESP32 isn't so chronically slow
|
|
|
|
#define AP_SCHEDULER_OVERTIME_MARGIN_US 50000UL
|