This commit is contained in:
Martin Budden 2016-06-23 09:56:41 +01:00
parent 0d00260ff2
commit 6bd1cc4dea
4 changed files with 1300 additions and 1302 deletions

View File

@ -38,7 +38,6 @@
#define NVIC_PRIO_MPU_DATA_READY NVIC_BUILD_PRIORITY(0x0f, 0x0f) #define NVIC_PRIO_MPU_DATA_READY NVIC_BUILD_PRIORITY(0x0f, 0x0f)
#define NVIC_PRIO_MAG_DATA_READY NVIC_BUILD_PRIORITY(0x0f, 0x0f) #define NVIC_PRIO_MAG_DATA_READY NVIC_BUILD_PRIORITY(0x0f, 0x0f)
#define NVIC_PRIO_CALLBACK NVIC_BUILD_PRIORITY(0x0f, 0x0f) #define NVIC_PRIO_CALLBACK NVIC_BUILD_PRIORITY(0x0f, 0x0f)
#define NVIC_PRIO_BST_READ_DATA NVIC_BUILD_PRIORITY(1, 1)
// utility macros to join/split priority // utility macros to join/split priority
#define NVIC_BUILD_PRIORITY(base,sub) (((((base)<<(4-(7-(NVIC_PRIORITY_GROUPING>>8))))|((sub)&(0x0f>>(7-(NVIC_PRIORITY_GROUPING>>8)))))<<4)&0xf0) #define NVIC_BUILD_PRIORITY(base,sub) (((((base)<<(4-(7-(NVIC_PRIORITY_GROUPING>>8))))|((sub)&(0x0f>>(7-(NVIC_PRIORITY_GROUPING>>8)))))<<4)&0xf0)

View File

@ -53,6 +53,3 @@ void bstMasterWriteLoop(void);
void crc8Cal(uint8_t data_in); void crc8Cal(uint8_t data_in);

View File

@ -17,6 +17,8 @@
#ifdef USE_BST #ifdef USE_BST
#define NVIC_PRIO_BST_READ_DATA NVIC_BUILD_PRIORITY(1, 1)
#define BST_SHORT_TIMEOUT ((uint32_t)0x1000) #define BST_SHORT_TIMEOUT ((uint32_t)0x1000)
#define BST_LONG_TIMEOUT ((uint32_t)(10 * BST_SHORT_TIMEOUT)) #define BST_LONG_TIMEOUT ((uint32_t)(10 * BST_SHORT_TIMEOUT))
@ -73,7 +75,7 @@ uint8_t bufferPointer = 0;
bool cleanflight_data_ready = false; bool cleanflight_data_ready = false;
uint8_t interruptCounter = 0; uint8_t interruptCounter = 0;
#define DEALY_SENDING_BYTE 40 #define DELAY_SENDING_BYTE 40
void bstProcessInCommand(void); void bstProcessInCommand(void);
void I2C_EV_IRQHandler() void I2C_EV_IRQHandler()
@ -110,7 +112,7 @@ void I2C_EV_IRQHandler()
I2C_ClearITPendingBit(BSTx, I2C_IT_TXIS); I2C_ClearITPendingBit(BSTx, I2C_IT_TXIS);
return; return;
} }
if(interruptCounter < DEALY_SENDING_BYTE) { if(interruptCounter < DELAY_SENDING_BYTE) {
interruptCounter++; interruptCounter++;
I2C_ClearITPendingBit(BSTx, I2C_IT_TXIS); I2C_ClearITPendingBit(BSTx, I2C_IT_TXIS);
return; return;