Skip to content

Commit

Permalink
Fix for STM32 board
Browse files Browse the repository at this point in the history
  • Loading branch information
pascallanger committed Oct 17, 2016
1 parent 8a177c3 commit eb6fc4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
18 changes: 7 additions & 11 deletions Multiprotocol/Multiprotocol.ino
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@
#include <avr/eeprom.h>
#else
#include <arduino.h>
#undef __cplusplus
#include <libmaple/usart.h>
#include <libmaple/timer.h>
#include <SPI.h>
#include <EEPROM.h>
HardwareTimer timer(2);
void PPM_decode();
void ISR_COMPB();
extern "C"
{
void __irq_usart2(void);
void __irq_usart3(void);
}
#endif

//Global constants/variables
Expand Down Expand Up @@ -119,10 +125,6 @@ volatile uint8_t rx_buff[RXBUFFER_SIZE];
volatile uint8_t rx_ok_buff[RXBUFFER_SIZE];
volatile uint8_t discard_frame = 0;

#ifdef STM32_BOARD
void PPM_decode();
void ISR_COMPB();
#endif
// Telemetry
#define MAX_PKT 27
uint8_t pkt[MAX_PKT];//telemetry receiving packets
Expand Down Expand Up @@ -1061,9 +1063,6 @@ static uint32_t random_id(uint16_t adress, uint8_t create_new)
#ifdef ORANGE_TX
ISR(USARTC0_RXC_vect)
#elif defined STM32_BOARD
#ifdef __cplusplus
extern "C" {
#endif
void __irq_usart2()
#else
ISR(USART_RX_vect)
Expand Down Expand Up @@ -1138,9 +1137,6 @@ static uint32_t random_id(uint16_t adress, uint8_t create_new)
UCSR0B |= _BV(RXCIE0) ; // RX interrupt enable
#endif
}
#if defined (STM32_BOARD) && defined (__cplusplus)
}
#endif

//Serial timer
#ifdef ORANGE_TX
Expand Down
8 changes: 0 additions & 8 deletions Multiprotocol/Telemetry.ino
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,6 @@ void TelemetryUpdate()
ISR(USARTC0_DRE_vect)
#else
#ifdef STM32_BOARD
#ifdef __cplusplus
extern "C" {
#endif
void __irq_usart3()
#else
ISR(USART_UDRE_vect)
Expand Down Expand Up @@ -630,11 +627,6 @@ void TelemetryUpdate()
tx_pause(); // Check if all data is transmitted . if yes disable transmitter UDRE interrupt
#endif
}
#if defined STM32_BOARD
#ifdef __cplusplus
}
#endif
#endif //STM32_BOARD

#else //BASH_SERIAL
// Routines for bit-bashed serial output
Expand Down

0 comments on commit eb6fc4f

Please sign in to comment.