From 49741ccae96f7e8ad0fd232965351018f77cf1fb Mon Sep 17 00:00:00 2001 From: "Larry (TBS)" Date: Fri, 12 Feb 2016 18:18:24 +0800 Subject: [PATCH] - Better BST Code --- src/main/drivers/bus_bst_stm32f30x.c | 2 +- src/main/scheduler.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/drivers/bus_bst_stm32f30x.c b/src/main/drivers/bus_bst_stm32f30x.c index e2b45e528d..d63323445f 100644 --- a/src/main/drivers/bus_bst_stm32f30x.c +++ b/src/main/drivers/bus_bst_stm32f30x.c @@ -320,7 +320,7 @@ bool bstSlaveWrite(uint8_t* data) { uint32_t bstMasterWriteTimeout = 0; void bstMasterWriteLoop(void) { - if(bstWriteDataLen != 0) { + while(bstWriteDataLen) { if(bufferPointer == 0) { bool scl_set = false; if(BSTx == I2C1) diff --git a/src/main/scheduler.c b/src/main/scheduler.c index 2e47d29d2c..c1f2585994 100755 --- a/src/main/scheduler.c +++ b/src/main/scheduler.c @@ -211,8 +211,8 @@ static cfTask_t cfTasks[TASK_COUNT] = { [TASK_BST_READ_WRITE] = { .taskName = "BST_MASTER_WRITE", .taskFunc = taskBstReadWrite, - .desiredPeriod = 1000000 / 500, // 500 Hz - .staticPriority = TASK_PRIORITY_HIGH, + .desiredPeriod = 1000000 / 100, // 100 Hz + .staticPriority = TASK_PRIORITY_IDLE, }, [TASK_BST_MASTER_PROCESS] = {