@iseries wrote:
Here are the files to turn on the board LED that will match the Toshiba LED.
Do to the craziness of the code there are number of modifications.In the AP_HAL_Boards.h file you need to add the following line in the subtypes:
#define HAL_BOARD_SUBTYPE_PX4_V4 2002
Replace the following lines with these lines in the HAL_BOARD_PX4 section:#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V1
#define HAL_STORAGE_SIZE 8192
#endif
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V2
#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V2
#define HAL_STORAGE_SIZE 16384
#endif
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V4
#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V4
#define HAL_STORAGE_SIZE 16384
#endif
Now in the AP_HAL_PX4 folder replace the GPIO.CPP program which starts the LED driver need to make the LED work:
GPIO.CPP
Hopefully this will not break any previous version of PX4 boards.
Now in the AP_Notify folder add two new files:
PixRacerLED.h
PixRacerLED.cppAnd lastly add this new driver into the AP_Notify.cpp code:
Add this line in the include section:
#include "PixRacerLED.h"
In the HAL_BOARD_PX4 section replaceAP_BoardLED boardled
with:#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_PX4_V4
PixRacerLED boardled;
#else
AP_BoardLED boardled;
#endif
That's all that is needed.
Mike
Posts: 4
Participants: 2