Addition of LED2 for iRangeX modules

This commit is contained in:
Pascal Langer 2018-01-25 11:07:54 +01:00
parent fb88eebc2f
commit f4a4f67453
3 changed files with 19 additions and 1 deletions

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_REVISION 0 #define VERSION_REVISION 0
#define VERSION_PATCH_LEVEL 14 #define VERSION_PATCH_LEVEL 15
//****************** //******************
// Protocols // Protocols
//****************** //******************

View File

@ -243,6 +243,7 @@ void setup()
#elif defined STM32_BOARD #elif defined STM32_BOARD
//STM32 //STM32
afio_cfg_debug_ports(AFIO_DEBUG_NONE); afio_cfg_debug_ports(AFIO_DEBUG_NONE);
pinMode(LED2_pin,OUTPUT);
pinMode(A7105_CSN_pin,OUTPUT); pinMode(A7105_CSN_pin,OUTPUT);
pinMode(CC25_CSN_pin,OUTPUT); pinMode(CC25_CSN_pin,OUTPUT);
pinMode(NRF_CSN_pin,OUTPUT); pinMode(NRF_CSN_pin,OUTPUT);
@ -313,6 +314,8 @@ void setup()
random_init(); random_init();
#endif #endif
LED2_on;
// Set Chip selects // Set Chip selects
#ifdef A7105_CSN_pin #ifdef A7105_CSN_pin
A7105_CSN_on; A7105_CSN_on;
@ -470,6 +473,7 @@ void setup()
#endif #endif
#endif //ENABLE_SERIAL #endif //ENABLE_SERIAL
} }
LED2_on;
debugln("Init complete"); debugln("Init complete");
} }
@ -1330,6 +1334,7 @@ void modules_reset()
{ {
usart_init(USART2); usart_init(USART2);
usart_config_gpios_async(USART2,GPIOA,PIN_MAP[PA3].gpio_bit,GPIOA,PIN_MAP[PA2].gpio_bit,config); usart_config_gpios_async(USART2,GPIOA,PIN_MAP[PA3].gpio_bit,GPIOA,PIN_MAP[PA2].gpio_bit,config);
LED2_output;
usart_set_baud_rate(USART2, STM32_PCLK1, baud); usart_set_baud_rate(USART2, STM32_PCLK1, baud);
usart_enable(USART2); usart_enable(USART2);
} }

View File

@ -190,6 +190,12 @@
#define IS_LED_on (LED_port & _BV(LED_pin)) #define IS_LED_on (LED_port & _BV(LED_pin))
#endif #endif
#define LED2_on
#define LED2_off
#define LED2_toggle
#define LED2_output
#define IS_LED2_on 0
//BIND //BIND
#ifdef ORANGE_TX #ifdef ORANGE_TX
#define BIND_pin 2 //PD2 #define BIND_pin 2 //PD2
@ -208,6 +214,7 @@
#else //STM32_BOARD #else //STM32_BOARD
#define BIND_pin PA0 #define BIND_pin PA0
#define LED_pin PA1 #define LED_pin PA1
#define LED2_pin PA2
// //
#define PPM_pin PA8 //PPM 5V tolerant #define PPM_pin PA8 //PPM 5V tolerant
// //
@ -284,6 +291,12 @@
#define LED_output pinMode(LED_pin,OUTPUT) #define LED_output pinMode(LED_pin,OUTPUT)
#define IS_LED_on ( digitalRead(LED_pin)==HIGH) #define IS_LED_on ( digitalRead(LED_pin)==HIGH)
#define LED2_on digitalWrite(LED2_pin,HIGH)
#define LED2_off digitalWrite(LED2_pin,LOW)
#define LED2_toggle digitalWrite(LED2_pin ,!digitalRead(LED2_pin))
#define LED2_output pinMode(LED2_pin,OUTPUT)
#define IS_LED2_on ( digitalRead(LED2_pin)==HIGH)
#define BIND_SET_INPUT pinMode(BIND_pin,INPUT) #define BIND_SET_INPUT pinMode(BIND_pin,INPUT)
#define BIND_SET_PULLUP digitalWrite(BIND_pin,HIGH) #define BIND_SET_PULLUP digitalWrite(BIND_pin,HIGH)
#define BIND_SET_OUTPUT pinMode(BIND_pin,OUTPUT) #define BIND_SET_OUTPUT pinMode(BIND_pin,OUTPUT)