PATCH: Responsitivity patch
This commit is contained in:
parent
2a9e8efb3d
commit
15352ddfcd
@ -218,14 +218,19 @@ int main(void) {
|
|||||||
|
|
||||||
static uint16_t old_minute_counter = minute_counter;
|
static uint16_t old_minute_counter = minute_counter;
|
||||||
|
|
||||||
|
static uint32_t dly_disp, dly_stats, dly_switch;
|
||||||
|
|
||||||
|
|
||||||
SendUartString(&huart1, "Hello from FloatPUMP Controller");
|
SendUartString(&huart1, "Hello from FloatPUMP Controller");
|
||||||
SendUartString(&huart1, {"Revision: " GIT_HASH});
|
SendUartString(&huart1, {"Revision: " GIT_HASH});
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
|
//Execute this block each second only
|
||||||
|
if(HAL_GetTick() > dly_disp + 1000)
|
||||||
|
{
|
||||||
|
dly_disp = HAL_GetTick();
|
||||||
display.LCDSetBacklight(S_backlight);
|
display.LCDSetBacklight(S_backlight);
|
||||||
|
|
||||||
char buf[20];
|
char buf[20];
|
||||||
|
|
||||||
display.LCDSetCursor(0, 0);
|
display.LCDSetCursor(0, 0);
|
||||||
@ -268,7 +273,7 @@ int main(void) {
|
|||||||
display.LCDSendCString(const_cast<char *>(std::string("Nachspeisung ok ").c_str()));
|
display.LCDSendCString(const_cast<char *>(std::string("Nachspeisung ok ").c_str()));
|
||||||
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Check for rotation to enable display backlight
|
//Check for rotation to enable display backlight
|
||||||
if (old_pos < rot_counter) {
|
if (old_pos < rot_counter) {
|
||||||
@ -316,7 +321,7 @@ int main(void) {
|
|||||||
old_pos = rot_counter;
|
old_pos = rot_counter;
|
||||||
last_menu_retrigger = HAL_GetTick();
|
last_menu_retrigger = HAL_GetTick();
|
||||||
}
|
}
|
||||||
HAL_Delay(100);
|
HAL_Delay(10);
|
||||||
|
|
||||||
//Execute Calibrations if necessary
|
//Execute Calibrations if necessary
|
||||||
if (a_caliblow) {
|
if (a_caliblow) {
|
||||||
@ -350,6 +355,10 @@ int main(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Execute this only each 5 seconds
|
||||||
|
if(HAL_GetTick() > dly_switch + 5000)
|
||||||
|
{
|
||||||
|
dly_switch = HAL_GetTick();
|
||||||
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET);
|
||||||
|
|
||||||
//Poll Sensors
|
//Poll Sensors
|
||||||
@ -373,10 +382,15 @@ int main(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET);
|
||||||
|
}
|
||||||
|
|
||||||
HAL_Delay(1000);
|
HAL_Delay(1000);
|
||||||
|
|
||||||
//Periodically send stats via uart in json format:
|
|
||||||
|
|
||||||
|
//Periodically send stats via uart in json format each minute
|
||||||
|
if(HAL_GetTick() > dly_stats + 60000)
|
||||||
|
{
|
||||||
|
dly_stats = HAL_GetTick();
|
||||||
char buffer[400];
|
char buffer[400];
|
||||||
sprintf(buffer, "{"
|
sprintf(buffer, "{"
|
||||||
"\"Status\": true, "
|
"\"Status\": true, "
|
||||||
@ -396,7 +410,8 @@ int main(void) {
|
|||||||
diff_hist_hour,
|
diff_hist_hour,
|
||||||
diff_hist_day);
|
diff_hist_day);
|
||||||
SendUartString(&huart1, buffer);
|
SendUartString(&huart1, buffer);
|
||||||
//HAL_UART_Transmit(&huart1, (uint8_t*) buffer, sizeof(buffer), 100);
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user