diff options
author | Ben V. Brown <[email protected]> | 2018-10-29 21:21:39 +1100 |
---|---|---|
committer | Ben V. Brown <[email protected]> | 2018-10-29 21:21:39 +1100 |
commit | 6b96474ab5da03f38173a7877c402ba7aea9fc23 (patch) | |
tree | 558d5e949b2a7c0676009be4506aadb36584016b | |
parent | 02bdf450b29b6bb237aa17f2adab529e57882f10 (diff) | |
download | IronOS-6b96474ab5da03f38173a7877c402ba7aea9fc23.tar.gz IronOS-6b96474ab5da03f38173a7877c402ba7aea9fc23.zip |
Trim in QC3 timings
-rw-r--r-- | workspace/TS100/src/hardware.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/workspace/TS100/src/hardware.c b/workspace/TS100/src/hardware.c index 32b55335..8b121d9f 100644 --- a/workspace/TS100/src/hardware.c +++ b/workspace/TS100/src/hardware.c @@ -144,7 +144,7 @@ uint16_t getInputVoltageX10(uint16_t divisor) { // Therefore we can divide down from there // Multiplying ADC max by 4 for additional calibration options, // ideal term is 467 -#define BATTFILTERDEPTH 64 +#define BATTFILTERDEPTH 32 static uint8_t preFillneeded = 1; static uint32_t samples[BATTFILTERDEPTH]; static uint8_t index = 0; @@ -174,7 +174,7 @@ void seekQC(int16_t Vx10,uint16_t divisor) { if (QCMode == 0) return; // NOT connected to a QC Charger - if (Vx10 < 50) + if (Vx10 < 45) return; if(Vx10>130) Vx10=130;//Cap max value at 13V @@ -190,15 +190,15 @@ void seekQC(int16_t Vx10,uint16_t divisor) { int steps = difference / 2; if (QCMode == 3) { while (steps < 0) { - HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET); - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET); - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_SET); - vTaskDelay(3); - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET); + HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET);//D+0.6 + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET);//D-3.3V + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_SET);// D-3.3Vs vTaskDelay(3); + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET);//-0.6V + HAL_Delay(1); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET); HAL_IWDG_Refresh(&hiwdg); - vTaskDelay(3); + HAL_Delay(1); steps++; } while (steps > 0) { @@ -209,10 +209,10 @@ void seekQC(int16_t Vx10,uint16_t divisor) { vTaskDelay(3); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_SET); - vTaskDelay(3); + HAL_Delay(1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET); HAL_IWDG_Refresh(&hiwdg); - vTaskDelay(3); + HAL_Delay(1); steps--; } } |