fix rc debug and ir logic

This commit is contained in:
2024-10-01 22:34:01 +03:00
parent 6c3af6fbb5
commit 839da85dfe
11 changed files with 154 additions and 91 deletions

View File

@ -104,7 +104,8 @@ void IR_CMD_Handler() {
lastRepeatTime = millis(); // Обновляем время последнего вызова
// uint8_t blinkPeriod = 10;
led_writeMirror(9, 1);
HAL_Delay(1);
led_writeMirror(9,0);
onHoldRepeat(); // Вызываем функцию при удержании
@ -129,16 +130,13 @@ void IR_CMD_Clear() {
inputInProgerss = 0;
digitInputInProgerss = 0;
inputParam = NULL_NumberParam;
// SetShiftReg_inline(0, 0xff, 0);
}
void IR_ParamEnter() {
// SetShiftReg_inline(0x03, 0, 0);
if (0 <= data.command && data.command <= 9) {
if (digitInputInProgerss) {
inputParam = inputParam * 10; // dec shift << 1
inputParam += (data.command + 1) % 10;
// SetShiftReg_inline(0xF0, 0, 0);
} else {
inputParam = (data.command + 1) % 10;
}
@ -151,13 +149,16 @@ void IR_ParamEnter() {
if(inputParam != NULL_NumberParam){
print("Enter: ");
printNumber(inputParam);
// SetShiftReg_inline(0, 0, inputParam);
onParamEnter();
}
inputParam = NULL_NumberParam;
digitInputInProgerss = 0;
break;
case IR_START:
break;
default:
IR_Home_Process();
break;