BST tidy
This commit is contained in:
parent
0d00260ff2
commit
6bd1cc4dea
|
@ -38,7 +38,6 @@
|
|||
#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_CALLBACK NVIC_BUILD_PRIORITY(0x0f, 0x0f)
|
||||
#define NVIC_PRIO_BST_READ_DATA NVIC_BUILD_PRIORITY(1, 1)
|
||||
|
||||
// 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)
|
||||
|
|
|
@ -53,6 +53,3 @@ void bstMasterWriteLoop(void);
|
|||
|
||||
void crc8Cal(uint8_t data_in);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
|
||||
#ifdef USE_BST
|
||||
#define NVIC_PRIO_BST_READ_DATA NVIC_BUILD_PRIORITY(1, 1)
|
||||
|
||||
#define BST_SHORT_TIMEOUT ((uint32_t)0x1000)
|
||||
#define BST_LONG_TIMEOUT ((uint32_t)(10 * BST_SHORT_TIMEOUT))
|
||||
|
||||
|
@ -73,7 +75,7 @@ uint8_t bufferPointer = 0;
|
|||
|
||||
bool cleanflight_data_ready = false;
|
||||
uint8_t interruptCounter = 0;
|
||||
#define DEALY_SENDING_BYTE 40
|
||||
#define DELAY_SENDING_BYTE 40
|
||||
|
||||
void bstProcessInCommand(void);
|
||||
void I2C_EV_IRQHandler()
|
||||
|
@ -110,7 +112,7 @@ void I2C_EV_IRQHandler()
|
|||
I2C_ClearITPendingBit(BSTx, I2C_IT_TXIS);
|
||||
return;
|
||||
}
|
||||
if(interruptCounter < DEALY_SENDING_BYTE) {
|
||||
if(interruptCounter < DELAY_SENDING_BYTE) {
|
||||
interruptCounter++;
|
||||
I2C_ClearITPendingBit(BSTx, I2C_IT_TXIS);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue