- added suspend mode command 'X'

- added timerStop()

git-svn-id: http://moon:8086/svn/projects/HendiControl@66 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-03-04 20:57:34 +00:00
parent 2d0b37a15d
commit f5fe03340f
3 changed files with 18 additions and 3 deletions
+9 -1
View File
@@ -130,7 +130,7 @@ int main(void)
if (c == 0x0A || c == 0x0D)
{
PRINT_PROMPT;
if (cmdStrSize < 2)
if (cmdStrSize < 1)
{
break;
}
@@ -154,6 +154,14 @@ int main(void)
timer_start(TIMER_TIMEOUT, TIMER_SW_DELAY_MS(5000));
state_next = StateRemote;
}
// Switch Control
if (toupper(cmdStr[0]) == 'X')
{
timer_stop(TIMER_TIMEOUT);
setPower(PowerLow);
setSwitch(SwitchOff);
}
}
cmdStrSize = 0;
}
+6
View File
@@ -57,3 +57,9 @@ void timer_start(TimerId timerId, uint16_t count)
exitCritial();
}
void timer_stop(TimerId timerId)
{
enterCritical();
user_timer[timerId].isRunning = 0;
exitCritial();
}
+3 -2
View File
@@ -20,8 +20,8 @@ typedef enum _eTimerId
typedef struct _sTimer_t
{
int isRunning;
uint16_t count;
volatile int isRunning;
volatile uint16_t count;
} Timer_t;
typedef enum _eTimerClockSel
@@ -39,4 +39,5 @@ typedef enum _eTimerClockSel
void timer_init(Fifo *pFifo, uint16_t TIMER_RELOAD, TimerClockSel clockSel);
void timer_start(TimerId timerId, uint16_t count);
void timer_stop(TimerId timerId);
#endif /* TIMER_H_ */