Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove VRBrain board sub-types #26583

Merged
merged 3 commits into from Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions libraries/AP_HAL/AP_HAL_Boards.h
Expand Up @@ -55,11 +55,11 @@
#define HAL_BOARD_SUBTYPE_CHIBIOS_FMUV4 5002
#define HAL_BOARD_SUBTYPE_CHIBIOS_GENERIC 5009
#define HAL_BOARD_SUBTYPE_CHIBIOS_FMUV5 5013
#define HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V51 5016
#define HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V52 5017
#define HAL_BOARD_SUBTYPE_CHIBIOS_VRUBRAIN_V51 5018
#define HAL_BOARD_SUBTYPE_CHIBIOS_VRCORE_V10 5019
#define HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V54 5020
// #define HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V51 5016
// #define HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V52 5017
// #define HAL_BOARD_SUBTYPE_CHIBIOS_VRUBRAIN_V51 5018
// #define HAL_BOARD_SUBTYPE_CHIBIOS_VRCORE_V10 5019
// #define HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V54 5020

#define HAL_BOARD_SUBTYPE_ESP32_DIY 6001
#define HAL_BOARD_SUBTYPE_ESP32_ICARUS 6002
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/VRBrain-v51/hwdef.dat
@@ -1,8 +1,6 @@
# hw definition file for processing by chibios_hwdef.py
# for VRBRAINv51 hardware

define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V51

# MCU class and specific type
MCU STM32F4xx STM32F407xx

Expand Down Expand Up @@ -139,6 +137,8 @@ define HAL_OS_FATFS_IO 1
define HAL_GPIO_LED_ON 0
define HAL_GPIO_LED_OFF 1

define AP_NOTIFY_VRBOARD_LED_ENABLED 1
define AP_NOTIFY_EXTERNALLED_ENABLED 1
define HAL_GPIO_A_LED_PIN 25
define HAL_GPIO_B_LED_PIN 26
define HAL_GPIO_C_LED_PIN 27
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/VRBrain-v52/hwdef.dat
@@ -1,8 +1,6 @@
# hw definition file for processing by chibios_hwdef.py
# for VRBRAINv52 hardware

define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V52

# MCU class and specific type
MCU STM32F4xx STM32F407xx

Expand Down Expand Up @@ -139,6 +137,8 @@ define HAL_OS_FATFS_IO 1
define HAL_GPIO_LED_ON 0
define HAL_GPIO_LED_OFF 1

define AP_NOTIFY_VRBOARD_LED_ENABLED 1
define AP_NOTIFY_EXTERNALLED_ENABLED 1
define HAL_GPIO_A_LED_PIN 25
define HAL_GPIO_B_LED_PIN 26
define HAL_GPIO_C_LED_PIN 27
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/VRBrain-v54/hwdef.dat
@@ -1,8 +1,6 @@
# hw definition file for processing by chibios_hwdef.py
# for VRBRAINv54 hardware

define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V54

# MCU class and specific type
MCU STM32F4xx STM32F427xx

Expand Down Expand Up @@ -140,6 +138,8 @@ define HAL_OS_FATFS_IO 1
define HAL_GPIO_LED_ON 0
define HAL_GPIO_LED_OFF 1

define AP_NOTIFY_VRBOARD_LED_ENABLED 1
define AP_NOTIFY_EXTERNALLED_ENABLED 1
define HAL_GPIO_A_LED_PIN 25
define HAL_GPIO_B_LED_PIN 26
define HAL_GPIO_C_LED_PIN 27
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/VRCore-v10/hwdef.dat
@@ -1,8 +1,6 @@
# hw definition file for processing by chibios_hwdef.py
# for VRCOREv10 hardware

define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_VRCORE_V10

# MCU class and specific type
MCU STM32F4xx STM32F407xx

Expand Down Expand Up @@ -139,6 +137,8 @@ define HAL_OS_FATFS_IO 1
define HAL_GPIO_LED_ON 0
define HAL_GPIO_LED_OFF 1

define AP_NOTIFY_VRBOARD_LED_ENABLED 1
define AP_NOTIFY_EXTERNALLED_ENABLED 1
define HAL_GPIO_A_LED_PIN 25
define HAL_GPIO_B_LED_PIN 26
define HAL_GPIO_C_LED_PIN 27
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/VRUBrain-v51/hwdef.dat
@@ -1,8 +1,6 @@
# hw definition file for processing by chibios_hwdef.py
# for VRUBRAINv51 hardware

define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_VRUBRAIN_V51

# MCU class and specific type
MCU STM32F4xx STM32F407xx

Expand Down Expand Up @@ -142,6 +140,8 @@ define HAL_OS_FATFS_IO 1
define HAL_GPIO_LED_ON 0
define HAL_GPIO_LED_OFF 1

define AP_NOTIFY_VRBOARD_LED_ENABLED 1
define AP_NOTIFY_EXTERNALLED_ENABLED 1
define HAL_GPIO_A_LED_PIN 25
define HAL_GPIO_B_LED_PIN 26
define HAL_GPIO_C_LED_PIN 27
Expand Down
6 changes: 3 additions & 3 deletions libraries/AP_Notify/AP_Notify.cpp
Expand Up @@ -303,14 +303,14 @@ void AP_Notify::add_backends(void)
#endif
#endif // CONFIG_HAL_BOARD == HAL_BOARD_LINUX

#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V51 || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V52 || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_VRUBRAIN_V51 || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_VRCORE_V10 || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V54
#if AP_NOTIFY_EXTERNALLED_ENABLED
ADD_BACKEND(new ExternalLED()); // despite the name this is a built in set of onboard LED's
#endif // CONFIG_HAL_BOARD_SUBTYPE == various CHIBIOS-VRBRAINs
#endif

#if defined(HAL_HAVE_PIXRACER_LED)
ADD_BACKEND(new PixRacerLED());
#elif (defined(HAL_GPIO_A_LED_PIN) && defined(HAL_GPIO_B_LED_PIN) && defined(HAL_GPIO_C_LED_PIN))
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V51 || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V52 || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_VRUBRAIN_V51 || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_VRCORE_V10 || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_VRBRAIN_V54
#if AP_NOTIFY_VRBOARD_LED_ENABLED
ADD_BACKEND(new VRBoard_LED());
#else
ADD_BACKEND(new AP_BoardLED());
Expand Down
8 changes: 8 additions & 0 deletions libraries/AP_Notify/AP_Notify_config.h
Expand Up @@ -25,6 +25,14 @@
#define AP_NOTIFY_DSHOT_LED_ENABLED HAL_SUPPORT_RCOUT_SERIAL
#endif

#ifndef AP_NOTIFY_VRBOARD_LED_ENABLED
#define AP_NOTIFY_VRBOARD_LED_ENABLED 0
#endif

#ifndef AP_NOTIFY_EXTERNALLED_ENABLED
#define AP_NOTIFY_EXTERNALLED_ENABLED 0
#endif

#ifndef AP_NOTIFY_LP5562_ENABLED
#define AP_NOTIFY_LP5562_ENABLED 1
#endif
Expand Down
6 changes: 6 additions & 0 deletions libraries/AP_Notify/ExternalLED.cpp
Expand Up @@ -12,6 +12,10 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AP_Notify_config.h"

#if AP_NOTIFY_EXTERNALLED_ENABLED

#include "ExternalLED.h"

#include "AP_Notify.h"
Expand Down Expand Up @@ -242,3 +246,5 @@ void ExternalLED::motor_led2(bool on_off)
bool ExternalLED::init(void) {return true;}
void ExternalLED::update(void) {return;}
#endif

#endif // AP_NOTIFY_EXTERNALLED_ENABLED
6 changes: 6 additions & 0 deletions libraries/AP_Notify/ExternalLED.h
Expand Up @@ -15,6 +15,10 @@

#pragma once

#include "AP_Notify_config.h"

#if AP_NOTIFY_EXTERNALLED_ENABLED

#include "NotifyDevice.h"

class ExternalLED: public NotifyDevice
Expand Down Expand Up @@ -64,3 +68,5 @@ class ExternalLED: public NotifyDevice
void motor_led1(bool on_off);
void motor_led2(bool on_off);
};

#endif // AP_NOTIFY_EXTERNALLED_ENABLED
9 changes: 5 additions & 4 deletions libraries/AP_Notify/VRBoard_LED.cpp
Expand Up @@ -16,13 +16,14 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AP_Notify_config.h"

#if AP_NOTIFY_VRBOARD_LED_ENABLED

#include "VRBoard_LED.h"

#include <AP_HAL/AP_HAL.h>

#if (defined(HAL_GPIO_A_LED_PIN) && defined(HAL_GPIO_B_LED_PIN) && \
defined(HAL_GPIO_C_LED_PIN))

#define VRBRAIN_LED_BRIGHT 1 // full brightness
#define VRBRAIN_LED_MEDIUM 1 // medium brightness
#define VRBRAIN_LED_DIM 1 // dim
Expand Down Expand Up @@ -68,4 +69,4 @@ bool VRBoard_LED::hw_set_rgb(uint8_t r, uint8_t g, uint8_t b){
return true;
}

#endif
#endif // AP_NOTIFY_VRBOARD_LED_ENABLED
6 changes: 6 additions & 0 deletions libraries/AP_Notify/VRBoard_LED.h
Expand Up @@ -20,6 +20,10 @@

#pragma once

#include "AP_Notify_config.h"

#if AP_NOTIFY_VRBOARD_LED_ENABLED

#include "RGBLed.h"
#include "AP_BoardLED.h"

Expand All @@ -31,3 +35,5 @@ class VRBoard_LED: public RGBLed {
protected:
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
};

#endif // AP_NOTIFY_VRBOARD_LED_ENABLED