From 31032f2e6ebea926f7d39bed9ba689b8210c1df8 Mon Sep 17 00:00:00 2001 From: Phil Tokumaru Date: Fri, 23 Aug 2024 16:31:42 -0700 Subject: [PATCH] Fixed Typos --- common/CommonConfig.h | 8 ++------ common/Varmint.cpp | 10 +++++++++- common/Varmint.h | 5 +++++ common/drivers/Adc.cpp | 2 +- common/drivers/Adis165xx.cpp | 2 +- common/drivers/Bmi088.cpp | 2 +- common/drivers/ByteFifo.h | 4 +--- common/drivers/DlhrL20G.cpp | 2 +- common/drivers/Dps310.cpp | 2 +- common/drivers/Eng094x.cpp | 2 +- common/drivers/Iis2mdc.cpp | 2 +- common/drivers/Ist8308.cpp | 2 +- common/drivers/Mcp4017.h | 5 +---- common/drivers/Ms4525.cpp | 2 +- common/drivers/PacketFifo.h | 6 +----- common/drivers/Pwm.cpp | 2 +- common/drivers/Pwm.h | 4 ---- common/drivers/Sbus.cpp | 2 +- common/drivers/Sd.cpp | 2 +- common/drivers/Sd.h | 4 +--- common/drivers/Spi.h | 4 +--- common/drivers/Status.h | 6 +++++- common/drivers/Telem.cpp | 2 +- common/drivers/Telem.h | 2 -- common/drivers/Time64.h | 16 ++++++---------- common/drivers/Ubx.cpp | 2 +- common/drivers/Vcp.cpp | 2 +- common/drivers/Vcp.h | 3 --- pixracer_pro/specific/BoardConfig.h | 2 +- pixracer_pro/specific/Varmint_Init.cpp | 6 +++++- varmint_10X/specific/BoardConfig.h | 2 +- varmint_10X/specific/Varmint_Init.cpp | 2 +- 32 files changed, 55 insertions(+), 64 deletions(-) diff --git a/common/CommonConfig.h b/common/CommonConfig.h index 1a5062a..3ac3cf5 100644 --- a/common/CommonConfig.h +++ b/common/CommonConfig.h @@ -47,16 +47,12 @@ #define DATA_RAM __attribute__((section(".data"))) __attribute__((aligned(32))) static ///////////////////////////////////////////////////////////////////////////////////////////// -// MiddleWare name : AL94.I-CUBE-USBD-COMPOSITE.1.0.3 +// USB MiddleWare // #define VCP_Transmit(buffer, length) CDC_Transmit(0, buffer, length) -//#define _USBD_USE_HS false -//extern PCD_HandleTypeDef hpcd_USB_OTG_FS; // USB FS (48 MB/s) - -#define _USBD_USE_CDC_ACM true // /dev/ttyACM* device type +#define _USBD_USE_CDC_ACM true #define _USBD_CDC_ACM_COUNT 1 // -// End MiddleWare name : AL94.I-CUBE-USBD-COMPOSITE.1.0.3 ///////////////////////////////////////////////////////////////////////////////////////////// #define EPOCH_HZ (400) diff --git a/common/Varmint.cpp b/common/Varmint.cpp index d3d8094..c76c7b1 100644 --- a/common/Varmint.cpp +++ b/common/Varmint.cpp @@ -118,7 +118,15 @@ void Varmint::serial_flush(void) ////////////////////////////////////////////////////////////////////////////////////////////////// // Report any initialization errors -void Varmint::sensors_init() { sensor_errors_ = 0; } +void Varmint::sensors_init() +{ + sensor_errors_ = 0; + + for(uint32_t i=0;istatus() != DRIVER_OK)sensor_errors_++; + } +} uint16_t Varmint::num_sensor_errors() { return sensor_errors_; } diff --git a/common/Varmint.h b/common/Varmint.h index fbe1723..b02f5a8 100644 --- a/common/Varmint.h +++ b/common/Varmint.h @@ -72,12 +72,17 @@ class Varmint : public rosflight_firmware::Board private: uint32_t serial_device_; uint32_t sensor_errors_ = 0; + uint32_t status_len_ = 0; + Status *status_list_[STATUS_LIST_MAX_LEN]; public: Varmint(){}; INTERFACE_LIST + Status* status(uint32_t n) { return status_list_[n];} + uint32_t status_len(void) { return status_len_;} + //////////////////////////////////////////////////////////////////////////////// // Required ROSflight Board HAL functions: diff --git a/common/drivers/Adc.cpp b/common/drivers/Adc.cpp index 1be798b..d0494b4 100644 --- a/common/drivers/Adc.cpp +++ b/common/drivers/Adc.cpp @@ -63,7 +63,7 @@ uint32_t Adc::init(uint16_t sample_rate_hz, ADC_HandleTypeDef * hadc_ext, ADC_TypeDef * adc_instance_int // This ADC has the calibration values ) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Adc"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Adc"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; hadcExt_ = hadc_ext; diff --git a/common/drivers/Adis165xx.cpp b/common/drivers/Adis165xx.cpp index 610e4fa..2ae2c09 100644 --- a/common/drivers/Adis165xx.cpp +++ b/common/drivers/Adis165xx.cpp @@ -74,7 +74,7 @@ uint32_t Adis165xx::init( uint16_t reset_pin, // Reset GPIO Pin TIM_HandleTypeDef * htim, TIM_TypeDef * htim_instance, uint32_t htim_channel, uint32_t htim_period_us) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Adis165xx"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Adis165xx"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; drdyPort_ = drdy_port; diff --git a/common/drivers/Bmi088.cpp b/common/drivers/Bmi088.cpp index 6786fe8..7743b2e 100644 --- a/common/drivers/Bmi088.cpp +++ b/common/drivers/Bmi088.cpp @@ -75,7 +75,7 @@ uint32_t Bmi088::init( uint8_t range_g // 0,1,2,3,4 --> 2000,1000,500,250,125 deg/s ) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Bmi088"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Bmi088"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; drdyPort_ = drdy_port; diff --git a/common/drivers/ByteFifo.h b/common/drivers/ByteFifo.h index bd6fd49..06bb771 100644 --- a/common/drivers/ByteFifo.h +++ b/common/drivers/ByteFifo.h @@ -45,12 +45,11 @@ class ByteFifo : public Status { public: - ByteFifo() { initializationStatus_ = DRIVER_NOT_INITIALIZED; } bool initGood(void) { return initializationStatus_ == DRIVER_OK; } void init(uint16_t buffer_size, uint8_t * buffer) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "ByteFifo"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "ByteFifo"); if (buffer == NULL) { bufferSize_ = 0; buffer_ = buffer; @@ -107,7 +106,6 @@ class ByteFifo : public Status volatile uint8_t *head_, *tail_; volatile uint8_t *buffer_, *bufferEnd_; uint32_t bufferSize_ = 0; - uint32_t initializationStatus_ = DRIVER_NOT_INITIALIZED; }; #endif /* BYTEFIFO_H_ */ diff --git a/common/drivers/DlhrL20G.cpp b/common/drivers/DlhrL20G.cpp index 3bb41ea..e4e0b8c 100644 --- a/common/drivers/DlhrL20G.cpp +++ b/common/drivers/DlhrL20G.cpp @@ -54,7 +54,7 @@ uint32_t DlhrL20G::init( I2C_HandleTypeDef * hi2c, uint16_t i2c_address // I2C initializers ) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "DlhrL20G"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "DlhrL20G"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; drdyPort_ = drdy_port; diff --git a/common/drivers/Dps310.cpp b/common/drivers/Dps310.cpp index f585198..ef5e1fe 100644 --- a/common/drivers/Dps310.cpp +++ b/common/drivers/Dps310.cpp @@ -106,7 +106,7 @@ uint32_t Dps310::init( // Mode bool three_wire) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Dps310"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Dps310"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; diff --git a/common/drivers/Eng094x.cpp b/common/drivers/Eng094x.cpp index 52eb75f..c08ce7d 100644 --- a/common/drivers/Eng094x.cpp +++ b/common/drivers/Eng094x.cpp @@ -58,7 +58,7 @@ uint32_t Eng094x::init( uint16_t cs_pin, // Chip Select GPIO Pin eng094x_press type) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Eng094x"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Eng094x"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; drdyPort_ = drdy_port; diff --git a/common/drivers/Iis2mdc.cpp b/common/drivers/Iis2mdc.cpp index de8d9fd..c10a7a8 100644 --- a/common/drivers/Iis2mdc.cpp +++ b/common/drivers/Iis2mdc.cpp @@ -74,7 +74,7 @@ uint32_t Iis2mdc::init( uint16_t cs_pin // Chip Select GPIO Pin ) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Iis2mdc"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Iis2mdc"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; drdyPort_ = drdy_port; diff --git a/common/drivers/Ist8308.cpp b/common/drivers/Ist8308.cpp index 9a61c37..b6f3ac4 100644 --- a/common/drivers/Ist8308.cpp +++ b/common/drivers/Ist8308.cpp @@ -102,7 +102,7 @@ uint32_t Ist8308::init( // I2C initializers I2C_HandleTypeDef * hi2c, uint16_t i2c_address) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Ist8308"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Ist8308"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; diff --git a/common/drivers/Mcp4017.h b/common/drivers/Mcp4017.h index ef20fc6..edf4c60 100644 --- a/common/drivers/Mcp4017.h +++ b/common/drivers/Mcp4017.h @@ -54,14 +54,12 @@ class Mcp4017 : public Status * */ public: - Mcp4017() { initializationStatus_ = DRIVER_NOT_INITIALIZED; } - uint32_t init(I2C_HandleTypeDef * hi2c, // The SPI handle uint16_t i2c_address, // Chip select Port double v // voltage ) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Mcp4017"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Mcp4017"); initializationStatus_ = DRIVER_OK; hi2c_ = hi2c; @@ -98,7 +96,6 @@ class Mcp4017 : public Status uint8_t pot_; I2C_HandleTypeDef * hi2c_; // The SPI handle uint16_t address_; // Chip select Port - uint32_t initializationStatus_ = 0; }; #endif /* DRIVERS_MCP4017_H_ */ diff --git a/common/drivers/Ms4525.cpp b/common/drivers/Ms4525.cpp index 0e46b28..ad6fd0b 100644 --- a/common/drivers/Ms4525.cpp +++ b/common/drivers/Ms4525.cpp @@ -54,7 +54,7 @@ uint32_t Ms4525::init( uint16_t i2c_address // Chip select Port ) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Ms4525"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Ms4525"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; diff --git a/common/drivers/PacketFifo.h b/common/drivers/PacketFifo.h index 76774d7..fe00506 100644 --- a/common/drivers/PacketFifo.h +++ b/common/drivers/PacketFifo.h @@ -54,12 +54,9 @@ typedef struct class PacketFifo : public Status { public: - PacketFifo() { initializationStatus_ = DRIVER_NOT_INITIALIZED; } - bool initGood(void) { return initializationStatus_ == DRIVER_OK; } - void init(uint16_t max_packets, uint16_t max_data_size, uint8_t * buffer_head) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "PacketFifo"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "PacketFifo"); initializationStatus_ = DRIVER_OK; if (buffer_head == NULL) // Maybe check for a valid range? { @@ -150,7 +147,6 @@ class PacketFifo : public Status volatile uint32_t bufferSize_; Packet packet_[PACKET_FIFO_MAX_BUFFERS]; - uint32_t initializationStatus_ = DRIVER_NOT_INITIALIZED; }; #endif /* PACKETFIFO_H_ */ diff --git a/common/drivers/Pwm.cpp b/common/drivers/Pwm.cpp index 80b7214..9d88a8c 100644 --- a/common/drivers/Pwm.cpp +++ b/common/drivers/Pwm.cpp @@ -63,7 +63,7 @@ void Pwm::updateConfig(const float * rate, uint32_t channels) uint32_t Pwm::init(void) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Pwm"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Pwm"); initializationStatus_ = DRIVER_OK; block_ = pwm_init; diff --git a/common/drivers/Pwm.h b/common/drivers/Pwm.h index 7a0b3e3..96a749a 100644 --- a/common/drivers/Pwm.h +++ b/common/drivers/Pwm.h @@ -75,9 +75,6 @@ typedef struct __attribute__((__packed__)) class Pwm : public Status { public: - Pwm() { initializationStatus_ = DRIVER_NOT_INITIALIZED; } - bool initGood(void) { return initializationStatus_ == DRIVER_OK; } - uint32_t init(void); void updateConfig(const float * rate, uint32_t channels); @@ -212,7 +209,6 @@ class Pwm : public Status uint32_t chan_[PWM_CHANNELS]; uint32_t (*dmaBuf_)[PWM_DMA_BUFFER_LEN]; uint32_t blockIndex_[PWM_CHANNELS]; - uint32_t initializationStatus_ = 0; }; #endif /* PWM_H_ */ diff --git a/common/drivers/Sbus.cpp b/common/drivers/Sbus.cpp index d96b6ab..8e5a699 100644 --- a/common/drivers/Sbus.cpp +++ b/common/drivers/Sbus.cpp @@ -83,7 +83,7 @@ uint32_t Sbus::init( // UART initializers UART_HandleTypeDef * huart, USART_TypeDef * huart_instance, DMA_HandleTypeDef * hdma_uart_rx, uint32_t baud) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Sbus"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Sbus"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; drdyPort_ = 0; // do not use diff --git a/common/drivers/Sd.cpp b/common/drivers/Sd.cpp index 8a76bce..c47687f 100644 --- a/common/drivers/Sd.cpp +++ b/common/drivers/Sd.cpp @@ -52,7 +52,7 @@ DMA_RAM uint8_t sd_tx_buf[SD_BUFF_SIZE]; uint32_t Sd::init(SD_HandleTypeDef * hsd, SD_TypeDef * hsd_instance) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Sd"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Sd"); initializationStatus_ = DRIVER_OK; hsd_ = hsd; hsd_->Instance = hsd_instance; diff --git a/common/drivers/Sd.h b/common/drivers/Sd.h index 9b8b5cc..417aea0 100644 --- a/common/drivers/Sd.h +++ b/common/drivers/Sd.h @@ -51,15 +51,13 @@ class Sd : public Status * */ public: - Sd() { initializationStatus_ = DRIVER_NOT_INITIALIZED; } - bool initGood(void) { return initializationStatus_ == DRIVER_OK; } uint32_t init(SD_HandleTypeDef * hsd, SD_TypeDef * hsd_instance); bool read(uint8_t * dest, size_t len); bool write(uint8_t * src, size_t len); private: SD_HandleTypeDef * hsd_; - uint32_t initializationStatus_ = 0; + }; #endif /* SD_H_ */ diff --git a/common/drivers/Spi.h b/common/drivers/Spi.h index 3b4d764..6032406 100644 --- a/common/drivers/Spi.h +++ b/common/drivers/Spi.h @@ -66,8 +66,6 @@ class Spi : public Status SPI_HandleTypeDef * hspi_; uint8_t * txBuffer_; uint8_t * rxBuffer_; - uint32_t initializationStatus_ = DRIVER_NOT_INITIALIZED; - public: // uint16_t size_; GPIO_TypeDef * port_; @@ -75,7 +73,7 @@ class Spi : public Status uint32_t init(SPI_HandleTypeDef * hspi, uint8_t * tx_buffer, uint8_t * rx_buffer, GPIO_TypeDef * cs_port, uint16_t cs_pin) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Spi"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Spi"); initializationStatus_ = DRIVER_OK; hspi_ = hspi; txBuffer_ = tx_buffer; diff --git a/common/drivers/Status.h b/common/drivers/Status.h index 8c33002..a142926 100644 --- a/common/drivers/Status.h +++ b/common/drivers/Status.h @@ -38,12 +38,16 @@ #ifndef STATUS_H_ #define STATUS_H_ -#define STATUS_NAME_MAX_LEN 32 +#define STATUS_LIST_MAX_LEN 16 +#define STATUS_NAME_MAX_LEN 16 class Status { public: + Status() { initializationStatus_ = DRIVER_NOT_INITIALIZED;} bool initGood(void) { return initializationStatus_ == DRIVER_OK; } + uint32_t status() { return initializationStatus_;} + char *name() { return name_;} protected: uint32_t initializationStatus_ = DRIVER_NOT_INITIALIZED; diff --git a/common/drivers/Telem.cpp b/common/drivers/Telem.cpp index 39479d0..00e411a 100644 --- a/common/drivers/Telem.cpp +++ b/common/drivers/Telem.cpp @@ -74,7 +74,7 @@ uint32_t Telem::init( //,void (*RxISR) (struct __UART_HandleTypeDef *huart) ) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Telem"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Telem"); initializationStatus_ = DRIVER_OK; // Common initializations sampleRateHz_ = sample_rate_hz; diff --git a/common/drivers/Telem.h b/common/drivers/Telem.h index 408c44d..1081dad 100644 --- a/common/drivers/Telem.h +++ b/common/drivers/Telem.h @@ -66,8 +66,6 @@ class Telem : public Status */ public: - Telem() { initializationStatus_ = DRIVER_NOT_INITIALIZED; } - bool initGood(void) { return initializationStatus_ == DRIVER_OK; } uint32_t init( // Driver initializers uint16_t sample_rate_hz, diff --git a/common/drivers/Time64.h b/common/drivers/Time64.h index 83a2466..b22f41c 100644 --- a/common/drivers/Time64.h +++ b/common/drivers/Time64.h @@ -46,13 +46,10 @@ class Time64 : public Status { public: - Time64() { initializationStatus_ = DRIVER_NOT_INITIALIZED; } - bool initGood(void) { return initializationStatus_ == DRIVER_OK; } - uint32_t init(TIM_HandleTypeDef * htim_low, TIM_TypeDef * instance_low, TIM_HandleTypeDef * htim_high, TIM_TypeDef * instance_high) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Time64"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Time64"); initializationStatus_ = DRIVER_OK; htimLow_ = htim_low; @@ -75,13 +72,13 @@ class Time64 : public Status htimLow_->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; if (HAL_TIM_Base_Init(htimLow_) != HAL_OK) { initializationStatus_ |= DRIVER_HAL_ERROR; - return DRIVER_HAL_ERROR; + return initializationStatus_; } sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; if (HAL_TIM_ConfigClockSource(htimLow_, &sClockSourceConfig) != HAL_OK) { initializationStatus_ |= DRIVER_HAL_ERROR; - return DRIVER_HAL_ERROR; + return initializationStatus_; } sMasterConfig.MasterOutputTrigger = TIM_TRGO_UPDATE; if (htimLow_->Instance == TIM8) sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET; @@ -89,7 +86,7 @@ class Time64 : public Status sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; if (HAL_TIMEx_MasterConfigSynchronization(htimLow_, &sMasterConfig) != HAL_OK) { initializationStatus_ |= DRIVER_HAL_ERROR; - return DRIVER_HAL_ERROR; + return initializationStatus_; } } // high timer (slave) @@ -108,7 +105,7 @@ class Time64 : public Status htimHigh_->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; if (HAL_TIM_Base_Init(htimHigh_) != HAL_OK) { initializationStatus_ |= DRIVER_HAL_ERROR; - return DRIVER_HAL_ERROR; + return initializationStatus_; } sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1; @@ -140,7 +137,7 @@ class Time64 : public Status sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; if (HAL_TIMEx_MasterConfigSynchronization(htimHigh_, &sMasterConfig) != HAL_OK) { initializationStatus_ |= DRIVER_HAL_ERROR; - return DRIVER_HAL_ERROR; + return initializationStatus_; } } @@ -185,7 +182,6 @@ class Time64 : public Status TIM_HandleTypeDef * htimLow_; TIM_HandleTypeDef * htimHigh_; uint32_t shift_; - uint32_t initializationStatus_ = DRIVER_NOT_INITIALIZED; }; #endif /* TIME64_H_ */ diff --git a/common/drivers/Ubx.cpp b/common/drivers/Ubx.cpp index fccba57..5cd7e39 100644 --- a/common/drivers/Ubx.cpp +++ b/common/drivers/Ubx.cpp @@ -58,7 +58,7 @@ uint32_t Ubx::init( UART_HandleTypeDef * huart, USART_TypeDef * huart_instance, DMA_HandleTypeDef * hdma_uart_rx, uint32_t baud, UbxProtocol ubx_protocol) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Ubx"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Ubx"); initializationStatus_ = DRIVER_OK; sampleRateHz_ = sample_rate_hz; drdyPort_ = drdy_port; diff --git a/common/drivers/Vcp.cpp b/common/drivers/Vcp.cpp index ed7e3a1..b82b866 100644 --- a/common/drivers/Vcp.cpp +++ b/common/drivers/Vcp.cpp @@ -54,7 +54,7 @@ DTCM_RAM uint8_t vcp_fifo_rx_buffer[VCP_RX_FIFO_BUFFER_BYTES]; uint32_t Vcp::init(uint16_t sample_rate_hz) { - snprintf(name_, STATUS_NAME_MAX_LEN, "-%s", "Vcp"); + snprintf(name_, STATUS_NAME_MAX_LEN, "%s", "Vcp"); initializationStatus_ = DRIVER_OK; // Common initializations sampleRateHz_ = sample_rate_hz; diff --git a/common/drivers/Vcp.h b/common/drivers/Vcp.h index 861e131..bf79626 100644 --- a/common/drivers/Vcp.h +++ b/common/drivers/Vcp.h @@ -51,9 +51,6 @@ class Vcp : public Status { public: - Vcp() { initializationStatus_ = DRIVER_NOT_INITIALIZED; } - bool initGood(void) { return initializationStatus_ == DRIVER_OK; } - uint32_t init(uint16_t sample_rate_hz); void poll(void); diff --git a/pixracer_pro/specific/BoardConfig.h b/pixracer_pro/specific/BoardConfig.h index bcc774f..183bf89 100644 --- a/pixracer_pro/specific/BoardConfig.h +++ b/pixracer_pro/specific/BoardConfig.h @@ -40,7 +40,7 @@ #include -//#define SANDBOX // set this via CMAKE +#define SANDBOX false // set this via CMAKE #define USE_TELEM 0 // 1 = use UART, 0 = use VCP for link to companion computer. // UART used for printf's diff --git a/pixracer_pro/specific/Varmint_Init.cpp b/pixracer_pro/specific/Varmint_Init.cpp index 3c377c6..08d6b60 100644 --- a/pixracer_pro/specific/Varmint_Init.cpp +++ b/pixracer_pro/specific/Varmint_Init.cpp @@ -247,7 +247,11 @@ void Varmint::init_board(void) PROBE3_LO; PROBE4_HI; -#if defined(SANDBOX) +#if SANDBOX + misc_printf("\n\nStarting Sandbox\n"); sandbox(); +#else + misc_printf("\n\nStarting Rosflight\n"); + verbose = false; #endif } diff --git a/varmint_10X/specific/BoardConfig.h b/varmint_10X/specific/BoardConfig.h index 61a72b0..7ff2890 100644 --- a/varmint_10X/specific/BoardConfig.h +++ b/varmint_10X/specific/BoardConfig.h @@ -40,7 +40,7 @@ #include -//#define SANDBOX // set this via CMAKE +#define SANDBOX false // set this via CMAKE #define USE_TELEM 0 // 1 = use UART, 0 = use VCP for link to companion computer. // UART used for printf's diff --git a/varmint_10X/specific/Varmint_Init.cpp b/varmint_10X/specific/Varmint_Init.cpp index 154cd4a..86d9e90 100644 --- a/varmint_10X/specific/Varmint_Init.cpp +++ b/varmint_10X/specific/Varmint_Init.cpp @@ -245,7 +245,7 @@ void Varmint::init_board(void) GRN_LO; BLU_LO; -#if defined(SANDBOX) +#if SANDBOX misc_printf("\n\nStarting Sandbox\n"); sandbox(); #else