AP_HAL_ESP32: fix the board names

This commit is contained in:
Wiktor Maslowski 2022-11-29 22:54:25 +01:00 committed by Peter Barker
parent 90cc4087e8
commit 128f52f807
5 changed files with 17 additions and 10 deletions

View File

@ -49,15 +49,13 @@ void SoftSigReaderRMT::init()
rmt_config_t config;
config.rmt_mode = RMT_MODE_RX;
config.channel = RMT_CHANNEL_0;
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_ICARUS
config.gpio_num = (gpio_num_t)36;
#endif
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_DIY
config.gpio_num = (gpio_num_t)4;
#endif
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_ESP32_BUZZ
config.gpio_num = (gpio_num_t)4;
#ifndef HAL_ESP32_RMT_RX_PIN_NUMBER
#error HAL_ESP32_RMT_RX_PIN_NUMBER undefined in libraries/AP_HAL_ESP32/boards/esp32... .h
#endif
config.gpio_num = (gpio_num_t)HAL_ESP32_RMT_RX_PIN_NUMBER;
config.clk_div = RMT_CLK_DIV;
config.mem_block_num = 1;
config.rx_config.filter_en = true;

View File

@ -217,7 +217,7 @@ Util::FlashBootloader Util::flash_bootloader()
bool Util::get_system_id(char buf[50])
{
//uint8_t serialid[12];
char board_name[14] = "esp32-buzz ";
char board_name[] = HAL_ESP32_BOARD_NAME" ";
uint8_t base_mac_addr[6] = {0};
esp_err_t ret = esp_efuse_mac_get_custom(base_mac_addr);
@ -230,7 +230,7 @@ bool Util::get_system_id(char buf[50])
base_mac_addr[0], base_mac_addr[1], base_mac_addr[2], base_mac_addr[3], base_mac_addr[4], base_mac_addr[5]);
// null terminate both
board_name[13] = 0;
//board_name[13] = 0;
board_mac[19] = 0;
// tack strings togehter

View File

@ -14,6 +14,8 @@
*/
#pragma once
#define HAL_ESP32_BOARD_NAME "esp32-buzz"
// make sensor selection clearer
#define PROBE_IMU_I2C(driver, bus, addr, args ...) ADD_BACKEND(AP_InertialSensor_ ## driver::probe(*this,GET_I2C_DEVICE(bus, addr),##args))
#define PROBE_IMU_SPI(driver, devname, args ...) ADD_BACKEND(AP_InertialSensor_ ## driver::probe(*this,hal.spi->get_device(devname),##args))
@ -180,3 +182,4 @@
// setting to 2 means log-over-mavlink to a companion computer etc.
#define HAL_LOGGING_BACKENDS_DEFAULT 1
#define HAL_ESP32_RMT_RX_PIN_NUMBER 4

View File

@ -14,6 +14,8 @@
*/
#pragma once
#define HAL_ESP32_BOARD_NAME "esp32-diy"
// make sensor selection clearer
#define PROBE_IMU_I2C(driver, bus, addr, args ...) ADD_BACKEND(AP_InertialSensor_ ## driver::probe(*this,GET_I2C_DEVICE(bus, addr),##args))
#define PROBE_IMU_SPI(driver, devname, args ...) ADD_BACKEND(AP_InertialSensor_ ## driver::probe(*this,hal.spi->get_device(devname),##args))
@ -111,3 +113,4 @@
#define HAL_ESP32_RMT_RX_PIN_NUMBER 4

View File

@ -14,6 +14,8 @@
*/
#pragma once
#define HAL_ESP32_BOARD_NAME "esp32-icarus"
#define HAL_INS_DEFAULT AP_FEATURE_BOARD_DETECT
#define HAL_INS_MPU60x0_NAME "MPU6000"
#define TRUE 1
@ -56,3 +58,4 @@
#define HAL_DISABLE_ADC_DRIVER 1
#define HAL_USE_ADC 0
#define HAL_ESP32_RMT_RX_PIN_NUMBER 36