Merge pull request #193 from gautierhattenberger/led

Led
This commit is contained in:
Gautier Hattenberger
2012-05-19 09:37:25 -07:00
50 changed files with 253 additions and 197 deletions
-4
View File
@@ -103,10 +103,6 @@ void ADS8344_init( void ) {
/* configure SS pin */
SetBit( ADS8344_SS_IODIR, ADS8344_SS_PIN); /* pin is output */
ADS8344Unselect(); /* pin low */
// FIXME, no hardcoded led numbers
LED_INIT(2);
LED_OFF(2);
}
static inline void read_values( void ) {
@@ -120,11 +120,6 @@ void sys_time_arch_init( void ) {
_VIC_CNTL(TIMER0_VIC_SLOT) = VIC_ENABLE | VIC_TIMER0;
/* address of the ISR */
_VIC_ADDR(TIMER0_VIC_SLOT) = (uint32_t)TIMER0_ISR;
//FIXME, no hardcoded led number
#ifdef TRIGGER_EXT
LED_INIT(3);
#endif
}
+1 -7
View File
@@ -15,14 +15,8 @@ int main (int argc, char** argv) {
int tx=0, rx=0;
int tx_shadow=1, rx_shadow=1;
mcu_init();
// FIXME, no hardcoded led numbers
LED_INIT(1);
led_init();
LED_ON(1);
LED_INIT(2);
LED_OFF(2);
LED_INIT(3);
LED_OFF(3);
/* TXD0 and TXD1 output */
SetBit(IO0DIR, TXD0_PIN);
+1 -9
View File
@@ -46,15 +46,7 @@ int main( void ) {
mcu_init();
sys_time_init();
// FIXME, no hardcoded led numbers
LED_INIT(1);
LED_ON(1);
LED_INIT(2);
LED_OFF(2);
LED_INIT(3);
LED_OFF(3);
led_init();
VCOM_allow_linecoding(1);
#ifdef USE_USB_SERIAL
+15 -5
View File
@@ -7,27 +7,37 @@
//#define HSE_TYPE RCC_HSE_ON
/* Onboard LEDs */
#define LED_1_BANK
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOC
#define LED_1_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_1_GPIO_PIN GPIO_Pin_12
#define LED_4_BANK
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_GPIO GPIOA
#define LED_4_GPIO_CLK RCC_APB2Periph_GPIOA
#define LED_4_GPIO_PIN GPIO_Pin_6
#define LED_5_BANK
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_GPIO GPIOA
#define LED_5_GPIO_CLK RCC_APB2Periph_GPIOA
#define LED_5_GPIO_PIN GPIO_Pin_7
#define LED_6_BANK
#ifndef USE_LED_6
#define USE_LED_6 1
#endif
#define LED_6_GPIO GPIOB
#define LED_6_GPIO_CLK RCC_APB2Periph_GPIOB
#define LED_6_GPIO_PIN GPIO_Pin_0
#define LED_7_BANK
#ifndef USE_LED_7
#define USE_LED_7 1
#endif
#define LED_7_GPIO GPIOB
#define LED_7_GPIO_CLK RCC_APB2Periph_GPIOB
#define LED_7_GPIO_PIN GPIO_Pin_1
-1
View File
@@ -49,7 +49,6 @@ void baro_init( void ) {
baro_board.value_filtered = 0;
baro_board.data_available = FALSE;
#ifdef ROTORCRAFT_BARO_LED
LED_INIT(ROTORCRAFT_BARO_LED);
LED_OFF(ROTORCRAFT_BARO_LED);
#endif
}
+18
View File
@@ -18,23 +18,41 @@
#define PCLK (CCLK / PBSD_VAL)
/* Onboard LEDs */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 25
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 24
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 23
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 31
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_BANK 1
#define LED_5_PIN 18
#define POWER_SWITCH_LED 5
#ifndef USE_LED_6
#define USE_LED_6 1
#endif
#define LED_6_BANK 1
#define LED_6_PIN 22
+15
View File
@@ -16,9 +16,15 @@
#ifdef FBW
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 24
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 31
@@ -69,12 +75,21 @@
/* sitl handles this board as a mono-processor one: unfortunately these
definitions are already in FBW */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 18
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 19
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 20
+13
View File
@@ -19,9 +19,16 @@
/* Onboard LEDs */
/* led 1 and led 2 are not seperate leds, but leds indicating the power switch status */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 18
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 19
@@ -29,9 +36,15 @@
#define POWER_SWITCH_2_LED 2
/* there are no actual leds 3 and 4, these defines are just to conveniently switch the buzzer and the cam switch */
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 20
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 25
+3 -1
View File
@@ -8,7 +8,9 @@
#define AHB_CLK 72000000
/* Onboard LEDs */
#define LED_1_BANK
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_STP08
// FIXME, this is just to make it compile
+15 -5
View File
@@ -9,34 +9,44 @@
/* Onboard LEDs */
/* red */
#define LED_1_BANK
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_CLK RCC_APB2ENR_IOPBEN | RCC_APB2ENR_AFIOEN
#define LED_1_GPIO_PIN GPIO4
#define LED_1_AFIO_REMAP AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_FULL_SWJ_NO_JNTRST
/* blue */
#define LED_2_BANK
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOC
#define LED_2_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_2_GPIO_PIN GPIO5
#define LED_2_AFIO_REMAP ((void)0)
/* blue */
#define LED_3_BANK
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_GPIO GPIOC
#define LED_3_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_3_GPIO_PIN GPIO2
#define LED_3_AFIO_REMAP ((void)0)
// GPIO pins
#define LED_4_BANK
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_GPIO GPIOC
#define LED_4_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_4_GPIO_PIN GPIO12
#define LED_4_AFIO_REMAP ((void)0)
#define LED_5_BANK
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_GPIO GPIOC
#define LED_5_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_5_GPIO_PIN GPIO10
+15 -9
View File
@@ -12,35 +12,45 @@
*/
/* red, on PA8 */
#define LED_1_BANK
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOA
#define LED_1_GPIO_CLK RCC_APB2ENR_IOPAEN
#define LED_1_GPIO_PIN GPIO8
#define LED_1_AFIO_REMAP ((void)0)
/* green, shared with JTAG_TRST */
#define LED_2_BANK
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_CLK RCC_APB2ENR_IOPBEN | RCC_APB2ENR_AFIOEN
#define LED_2_GPIO_PIN GPIO4
#define LED_2_AFIO_REMAP AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_FULL_SWJ_NO_JNTRST
/* green, shared with ADC12 (ADC_6 on connector ANALOG2) */
#define LED_3_BANK
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_GPIO GPIOC
#define LED_3_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_3_GPIO_PIN GPIO2
#define LED_3_AFIO_REMAP ((void)0)
/* red, shared with ADC15 (ADC_4 on connector ANALOG2) */
#define LED_4_BANK
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_GPIO GPIOC
#define LED_4_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_4_GPIO_PIN GPIO5
#define LED_4_AFIO_REMAP ((void)0)
/* green, on PC15 */
#define LED_5_BANK
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_GPIO GPIOC
#define LED_5_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_5_GPIO_PIN GPIO15
@@ -50,21 +60,18 @@
* LEDs not populated by default
*/
/* PC3, ADC13 on ADC_1 */
#define LED_6_BANK
#define LED_6_GPIO GPIOC
#define LED_6_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_6_GPIO_PIN GPIO3
#define LED_6_AFIO_REMAP ((void)0)
/* PC0, ADC10 on ADC_2 */
#define LED_7_BANK
#define LED_7_GPIO GPIOC
#define LED_7_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_7_GPIO_PIN GPIO0
#define LED_7_AFIO_REMAP ((void)0)
/* PC1, ADC11 on ADC_3 */
#define LED_8_BANK
#define LED_8_GPIO GPIOC
#define LED_8_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_8_GPIO_PIN GPIO1
@@ -76,7 +83,6 @@
*/
/* PC12, on GPIO connector*/
#define LED_12_BANK
#define LED_12_GPIO GPIOC
#define LED_12_GPIO_CLK RCC_APB2ENR_IOPCEN
#define LED_12_GPIO_PIN GPIO12
+22 -2
View File
@@ -35,27 +35,47 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 16
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 0
#define LED_2_PIN 2
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 0
#define LED_3_PIN 11
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 17
#define POWER_SWITCH_LED 4
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_BANK 1
#define LED_5_PIN 18
#define CAM_SWITCH_LED 5
#define LED_GPS_RESET_BANK 1
#define LED_GPS_RESET_PIN 19
#ifndef USE_LED_6
#define USE_LED_6 1
#endif
#define LED_6_BANK 1
#define LED_6_PIN 19
#define GPS_RESET 6
#define Configure_GPS_RESET_Pin() LED_INIT(GPS_RESET)
#define Set_GPS_RESET_Pin_LOW() LED_ON(GPS_RESET)
-1
View File
@@ -43,7 +43,6 @@ void baro_init( void ) {
baro.absolute = 0;
baro.differential = 0; /* not handled on this board */
#ifdef ROTORCRAFT_BARO_LED
LED_INIT(ROTORCRAFT_BARO_LED);
LED_OFF(ROTORCRAFT_BARO_LED);
#endif
startup_cnt = STARTUP_COUNTER;
+12
View File
@@ -18,15 +18,27 @@
#define PCLK (CCLK / PBSD_VAL)
/* Onboard LEDs */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 0
#define LED_1_PIN 22
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 28
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 29
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 30
+6
View File
@@ -13,9 +13,15 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 24
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 23
+3 -1
View File
@@ -6,7 +6,9 @@
#define AHB_CLK 72000000
/* Onboard LEDs */
#define LED_1_BANK
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOC
#define LED_1_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_1_GPIO_PIN GPIO_Pin_12
+22 -2
View File
@@ -39,27 +39,47 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 17
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 16
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 23
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 18
#define POWER_SWITCH_LED 4
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_BANK 1
#define LED_5_PIN 22
#define CAM_SWITCH_LED 5
#define LED_GPS_RESET_BANK 1
#define LED_GPS_RESET_PIN 21
#ifndef USE_LED_6
#define USE_LED_6 1
#endif
#define LED_6_BANK 1
#define LED_6_PIN 21
#define GPS_RESET 6
#define Configure_GPS_RESET_Pin() LED_INIT(GPS_RESET)
#define Set_GPS_RESET_Pin_LOW() LED_ON(GPS_RESET)
+6
View File
@@ -23,9 +23,15 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 28
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 19
+9
View File
@@ -25,13 +25,22 @@
#define PCLK (CCLK / PBSD_VAL)
/* Onboard leds */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 28
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 19
/* Switch pin */
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 0
#define LED_3_PIN 11
+12
View File
@@ -23,15 +23,27 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 17
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 16
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 23
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 18
+22 -2
View File
@@ -37,27 +37,47 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 17
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 16
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 23
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 18
#define POWER_SWITCH_LED 4
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_BANK 1
#define LED_5_PIN 22
#define CAM_SWITCH_LED 5
#define LED_GPS_RESET_BANK 1
#define LED_GPS_RESET_PIN 21
#ifndef USE_LED_6
#define USE_LED_6 1
#endif
#define LED_6_BANK 1
#define LED_6_PIN 21
#define GPS_RESET 6
#define Configure_GPS_RESET_Pin() LED_INIT(GPS_RESET)
#define Set_GPS_RESET_Pin_LOW() LED_ON(GPS_RESET)
+6
View File
@@ -17,9 +17,15 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 28
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 19
+6
View File
@@ -18,9 +18,15 @@
#define PCLK (CCLK / PBSD_VAL)
/* Onboard LEDs */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 25
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 24
@@ -169,15 +169,6 @@ void init_ap( void ) {
mcu_init();
#endif /* SINGLE_MCU */
#ifdef POWER_SWITCH_LED
LED_INIT(POWER_SWITCH_LED);
LED_OFF(POWER_SWITCH_LED);
#endif
#ifdef AHRS_CPU_LED
LED_INIT(AHRS_CPU_LED);
LED_OFF(AHRS_CPU_LED);
#endif
/************* Sensors initialization ***************/
#if USE_GPS
gps_init();
+1 -13
View File
@@ -572,19 +572,7 @@ int main(void)
static inline void main_init( void ) {
mcu_init();
sys_time_init();
LED_INIT(LED_RED);
LED_OFF(LED_RED);
LED_INIT(LED_GREEN);
LED_OFF(LED_GREEN);
LED_INIT(LED_YELLOW);
LED_OFF(LED_YELLOW);
//FIXME, no hardcoded led numbers
LED_INIT(1);
LED_OFF(1);
LED_INIT(2);
LED_OFF(2);
led_init();
#ifdef USE_MAX11040
max11040_init_ssp();
@@ -78,7 +78,6 @@ void autopilot_init(void) {
autopilot_rc = TRUE;
autopilot_power_switch = FALSE;
#ifdef POWER_SWITCH_LED
LED_INIT(POWER_SWITCH_LED);
LED_ON(POWER_SWITCH_LED); // POWER OFF
#endif
autopilot_arming_init();
+21 -16
View File
@@ -36,45 +36,50 @@
#include "led_hw.h"
static inline void led_init ( void ) {
#ifdef LED_1_BANK
#if USE_LED_1
LED_INIT(1);
LED_OFF(1);
#endif /* LED_1_BANK */
#endif /* LED_1 */
#ifdef LED_2_BANK
#if USE_LED_2
LED_INIT(2);
LED_OFF(2);
#endif /* LED_2_BANK */
#endif /* LED_2 */
#ifdef LED_3_BANK
#if USE_LED_3
LED_INIT(3);
LED_OFF(3);
#endif /* LED_3_BANK */
#endif /* LED_3 */
#ifdef LED_4_BANK
#if USE_LED_4
LED_INIT(4);
LED_OFF(4);
#endif /* LED_4_BANK */
#endif /* LED_4 */
#ifdef LED_5_BANK
#if USE_LED_5
LED_INIT(5);
LED_OFF(5);
#endif /* LED_5_BANK */
#endif /* LED_5 */
#ifdef LED_6_BANK
#if USE_LED_6
LED_INIT(6);
LED_OFF(6);
#endif /* LED_6_BANK */
#endif /* LED_6 */
#ifdef LED_7_BANK
#if USE_LED_7
LED_INIT(7);
LED_OFF(7);
#endif /* LED_7_BANK */
#endif /* LED_7 */
#ifdef LED_8_BANK
#if USE_LED_8
LED_INIT(8);
LED_OFF(8);
#endif /* LED_8_BANK */
#endif /* LED_8 */
#if USE_LED_12
LED_INIT(12);
LED_OFF(12);
#endif /* LED_12 */
}
#else /* USE_LED */
-5
View File
@@ -10,11 +10,6 @@ void overo_link_init(void) {
overo_link.crc_error = FALSE;
overo_link.timeout = FALSE;
overo_link_arch_init();
LED_INIT(OVERO_LINK_LED_OK);
LED_INIT(OVERO_LINK_LED_KO);
LED_OFF(OVERO_LINK_LED_OK);
LED_OFF(OVERO_LINK_LED_KO);
}
-2
View File
@@ -53,8 +53,6 @@ int main(void) {
static inline void main_init( void ) {
mcu_init();
LED_INIT(3);
LED_OFF(3);
sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
main_spi_slave_init();
}
-4
View File
@@ -52,10 +52,6 @@ int main(void) {
static inline void main_init( void ) {
mcu_init();
sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
LED_INIT(1);
LED_INIT(2);
LED_OFF(1);
LED_OFF(2);
}
static inline void main_periodic( void ) {
-3
View File
@@ -55,9 +55,6 @@ int main(void) {
mcu_init();
sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
LED_INIT(2);
LED_OFF(2);
/* init RCC */
RCC_APB2PeriphClockCmd(A_PERIPH , ENABLE);
// RCC_APB2PeriphClockCmd(B_PERIPH , ENABLE);
+3
View File
@@ -60,6 +60,9 @@ void mcu_init(void) {
#ifdef PERIPHERALS_AUTO_INIT
sys_time_init();
#ifdef USE_LED
led_init();
#endif
/* for now this means using spektrum */
#if defined RADIO_CONTROL & defined RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT & defined RADIO_CONTROL_BIND_IMPL_FUNC
RADIO_CONTROL_BIND_IMPL_FUNC();
-6
View File
@@ -29,7 +29,6 @@
#include "mcu_periph/sys_time.h"
#include "mcu.h"
#include "led.h"
struct sys_time sys_time;
@@ -70,11 +69,6 @@ void sys_time_update_timer(tid_t id, float duration) {
void sys_time_init( void ) {
sys_time_arch_init();
#ifdef SYS_TIME_LED
LED_INIT(SYS_TIME_LED);
LED_OFF(SYS_TIME_LED);
#endif
sys_time.nb_sec = 0;
sys_time.nb_sec_rem = 0;
sys_time.nb_tick = 0;
@@ -33,12 +33,8 @@ volatile uint8_t i2c_abuse_test_counter = 0;
volatile uint32_t i2c_abuse_test_bitrate = 1000;
void init_i2c_abuse_test(void) {
LED_INIT(4);
LED_OFF(4);
LED_INIT(5);
LED_OFF(5);
LED_INIT(I2C_ABUSE_LED);
LED_OFF(I2C_ABUSE_LED);
//LED_INIT(DEMO_MODULE_LED);
//LED_OFF(DEMO_MODULE_LED);
i2c_test1.status = I2CTransSuccess;
i2c_test1.slave_addr = 0x3C;
@@ -73,8 +73,6 @@ int16_t booz_cam_pan;
#endif
void booz_cam_init(void) {
LED_INIT(CAM_SWITCH_LED);
LED_ON(CAM_SWITCH_LED);
booz_cam_SetCamMode(BOOZ_CAM_DEFAULT_MODE);
#ifdef BOOZ_CAM_USE_TILT
booz_cam_tilt_pwm = BOOZ_CAM_TILT_NEUTRAL;
-4
View File
@@ -101,10 +101,6 @@ void cam_waypoint_target(void);
void cam_ac_target(void);
void cam_init( void ) {
#ifdef VIDEO_TX_SWITCH
LED_INIT(VIDEO_TX_SWITCH);
#endif
cam_mode = CAM_MODE0;
}
@@ -54,17 +54,6 @@ extern uint8_t dc_timer;
static inline void led_cam_ctrl_init(void)
{
LED_INIT(DC_SHUTTER_LED);
#ifdef DC_ZOOM_IN_LED
LED_INIT(DC_ZOOM_IN_LED);
#endif
#ifdef DC_ZOOM_OUT_LED
LED_INIT(DC_ZOOM_OUT_LED);
#endif
#ifdef DC_POWER_LED
LED_INIT(DC_POWER_LED);
#endif
// Call common DC init
dc_init();
-2
View File
@@ -152,8 +152,6 @@ static uint8_t gcs_index_max;
/*****************************************************************************/
void gsm_init(void) {
LED_INIT(GSM_ONOFF_LED);
if (gsm_status == STATUS_NONE) { /* First call */
LED_ON(GSM_ONOFF_LED);
gsm_status = STATUS_POWERON;
-3
View File
@@ -38,9 +38,6 @@ volatile uint8_t new_ins_attitude;
void ins_init( void )
{
// FIXME, don't use hardcode led number here
LED_INIT(3);
// uint8_t ping[7] = {CHIMU_STX, CHIMU_STX, 0x01, CHIMU_BROADCAST, MSG00_PING, 0x00, 0xE6 };
uint8_t rate[12] = {CHIMU_STX, CHIMU_STX, 0x06, CHIMU_BROADCAST, MSG10_UARTSETTINGS, 0x05, 0xff, 0x79, 0x00, 0x00, 0x01, 0x76 }; // 50Hz attitude only + SPI
uint8_t quaternions[7] = {CHIMU_STX, CHIMU_STX, 0x01, CHIMU_BROADCAST, MSG09_ESTIMATOR, 0x01, 0x39 }; // 25Hz attitude only + SPI
-3
View File
@@ -37,9 +37,6 @@ volatile uint8_t new_ins_attitude;
void ins_init( void )
{
// FIXME, don't use hardcode led number here
LED_INIT(3);
uint8_t ping[7] = {CHIMU_STX, CHIMU_STX, 0x01, CHIMU_BROADCAST, MSG00_PING, 0x00, 0xE6 };
uint8_t rate[12] = {CHIMU_STX, CHIMU_STX, 0x06, CHIMU_BROADCAST, MSG10_UARTSETTINGS, 0x05, 0xff, 0x79, 0x00, 0x00, 0x01, 0x76 }; // 50Hz attitude only + SPI
uint8_t quaternions[7] = {CHIMU_STX, CHIMU_STX, 0x01, CHIMU_BROADCAST, MSG09_ESTIMATOR, 0x01, 0x39 }; // 25Hz attitude only + SPI
-8
View File
@@ -226,14 +226,6 @@ volatile int xsens_configured = 0;
void ins_init( void ) {
// FIXME, don't use hardcode led number here
LED_INIT(3);
#ifdef GPS_LED
LED_INIT(GPS_LED);
LED_OFF(GPS_LED);
#endif
xsens_status = UNINIT;
xsens_configured = 20;
+1 -6
View File
@@ -237,13 +237,8 @@ uint8_t humid_sht_reset( void )
void humid_sht_init( void )
{
// FIXME, should not use hardcoded led number
LED_INIT(2);
LED_OFF(2);
// FIXME, should not contain arch dependent code here
/* Configure DAT/SCL pin as GPIO */
#if (DAT_PIN<16)
PINSEL0 &= ~(_BV(DAT_PIN*2)|_BV(DAT_PIN*2+1));
#else
+1 -4
View File
@@ -36,10 +36,7 @@ int main( void ) {
static inline void main_init( void ) {
mcu_init();
sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
LED_INIT(1);
LED_OFF(1);
led_init();
Uart0Init();
spi_init();
@@ -46,11 +46,6 @@ void ahrs_aligner_init(void) {
samples_idx = 0;
ahrs_aligner.noise = 0;
ahrs_aligner.low_noise_cnt = 0;
#ifdef AHRS_ALIGNER_LED
LED_INIT(AHRS_ALIGNER_LED);
LED_OFF(AHRS_ALIGNER_LED);
#endif
}
#ifndef LOW_NOISE_THRESHOLD
-1
View File
@@ -38,7 +38,6 @@ void gps_init(void) {
gps.fix = GPS_FIX_NONE;
gps.cacc = 0;
#ifdef GPS_LED
LED_INIT(GPS_LED);
LED_OFF(GPS_LED);
#endif
#ifdef GPS_TYPE_H
-5
View File
@@ -71,11 +71,6 @@ static inline void radio_control_init ( void ) {
radio_control.frame_rate = 0;
radio_control.frame_cpt = 0;
radio_control_impl_init();
#if defined RADIO_CONTROL_LED
LED_INIT(RADIO_CONTROL_LED);
LED_OFF(RADIO_CONTROL_LED);
#endif
}
/************* PERIODIC ******************************************************/
@@ -11,20 +11,6 @@ static inline void main_event( void );
int main(void) {
mcu_init();
#ifdef LED_GREEN
LED_INIT(LED_GREEN);
LED_OFF(LED_GREEN);
#endif
#ifdef LED_BLUE
LED_INIT(LED_BLUE);
LED_OFF(LED_BLUE);
#endif
#ifdef LED_RED
LED_INIT(LED_RED);
LED_OFF(LED_RED);
#endif
unsigned int tmr_02 = sys_time_register_timer(0.2, NULL);
unsigned int tmr_03 = sys_time_register_timer(0.3, NULL);
sys_time_register_timer(0.5, main_periodic_05);
+1 -6
View File
@@ -61,11 +61,6 @@ static inline void main_init( void ) {
mcu_init();
#ifdef BOARD_LISA_L
LED_INIT(3);
LED_OFF(3);
#endif
sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
imu_init();
@@ -76,7 +71,7 @@ static inline void main_init( void ) {
static inline void led_toggle ( void ) {
#ifdef BOARD_LISA_L
LED_TOGGLE(3);
LED_TOGGLE(3);
#endif
}
+1 -4
View File
@@ -21,10 +21,7 @@ static struct adc_buf buf_adc[NB_ADC];
int main (int argc, char** argv) {
mcu_init();
sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
LED_INIT(1);
LED_OFF(1);
led_init();
adc_init();
adc_buf_channel(ADC_0, &buf_adc[0], ADC_NB_SAMPLES);