AP_Notify: remove VRBrain board sub-types

these were only used to turn choose between AP_Notify LED backends, which can be done much more neatly with specific features defines.
This commit is contained in:
Peter Barker 2024-03-22 14:06:31 +11:00 committed by Andrew Tridgell
parent 3387cad322
commit 44477c3b62
6 changed files with 34 additions and 7 deletions

View File

@ -303,14 +303,14 @@ void AP_Notify::add_backends(void)
#endif #endif
#endif // CONFIG_HAL_BOARD == HAL_BOARD_LINUX #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 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) #if defined(HAL_HAVE_PIXRACER_LED)
ADD_BACKEND(new PixRacerLED()); ADD_BACKEND(new PixRacerLED());
#elif (defined(HAL_GPIO_A_LED_PIN) && defined(HAL_GPIO_B_LED_PIN) && defined(HAL_GPIO_C_LED_PIN)) #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()); ADD_BACKEND(new VRBoard_LED());
#else #else
ADD_BACKEND(new AP_BoardLED()); ADD_BACKEND(new AP_BoardLED());

View File

@ -25,6 +25,14 @@
#define AP_NOTIFY_DSHOT_LED_ENABLED HAL_SUPPORT_RCOUT_SERIAL #define AP_NOTIFY_DSHOT_LED_ENABLED HAL_SUPPORT_RCOUT_SERIAL
#endif #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 #ifndef AP_NOTIFY_LP5562_ENABLED
#define AP_NOTIFY_LP5562_ENABLED 1 #define AP_NOTIFY_LP5562_ENABLED 1
#endif #endif

View File

@ -12,6 +12,10 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. 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 "ExternalLED.h"
#include "AP_Notify.h" #include "AP_Notify.h"
@ -242,3 +246,5 @@ void ExternalLED::motor_led2(bool on_off)
bool ExternalLED::init(void) {return true;} bool ExternalLED::init(void) {return true;}
void ExternalLED::update(void) {return;} void ExternalLED::update(void) {return;}
#endif #endif
#endif // AP_NOTIFY_EXTERNALLED_ENABLED

View File

@ -15,6 +15,10 @@
#pragma once #pragma once
#include "AP_Notify_config.h"
#if AP_NOTIFY_EXTERNALLED_ENABLED
#include "NotifyDevice.h" #include "NotifyDevice.h"
class ExternalLED: public NotifyDevice class ExternalLED: public NotifyDevice
@ -64,3 +68,5 @@ private:
void motor_led1(bool on_off); void motor_led1(bool on_off);
void motor_led2(bool on_off); void motor_led2(bool on_off);
}; };
#endif // AP_NOTIFY_EXTERNALLED_ENABLED

View File

@ -16,13 +16,14 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. 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 "VRBoard_LED.h"
#include <AP_HAL/AP_HAL.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_BRIGHT 1 // full brightness
#define VRBRAIN_LED_MEDIUM 1 // medium brightness #define VRBRAIN_LED_MEDIUM 1 // medium brightness
#define VRBRAIN_LED_DIM 1 // dim #define VRBRAIN_LED_DIM 1 // dim
@ -68,4 +69,4 @@ bool VRBoard_LED::hw_set_rgb(uint8_t r, uint8_t g, uint8_t b){
return true; return true;
} }
#endif #endif // AP_NOTIFY_VRBOARD_LED_ENABLED

View File

@ -20,6 +20,10 @@
#pragma once #pragma once
#include "AP_Notify_config.h"
#if AP_NOTIFY_VRBOARD_LED_ENABLED
#include "RGBLed.h" #include "RGBLed.h"
#include "AP_BoardLED.h" #include "AP_BoardLED.h"
@ -31,3 +35,5 @@ public:
protected: protected:
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override; bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
}; };
#endif // AP_NOTIFY_VRBOARD_LED_ENABLED