- 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:
@@ -130,7 +130,7 @@ int main(void)
|
|||||||
if (c == 0x0A || c == 0x0D)
|
if (c == 0x0A || c == 0x0D)
|
||||||
{
|
{
|
||||||
PRINT_PROMPT;
|
PRINT_PROMPT;
|
||||||
if (cmdStrSize < 2)
|
if (cmdStrSize < 1)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -154,6 +154,14 @@ int main(void)
|
|||||||
timer_start(TIMER_TIMEOUT, TIMER_SW_DELAY_MS(5000));
|
timer_start(TIMER_TIMEOUT, TIMER_SW_DELAY_MS(5000));
|
||||||
state_next = StateRemote;
|
state_next = StateRemote;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Switch Control
|
||||||
|
if (toupper(cmdStr[0]) == 'X')
|
||||||
|
{
|
||||||
|
timer_stop(TIMER_TIMEOUT);
|
||||||
|
setPower(PowerLow);
|
||||||
|
setSwitch(SwitchOff);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cmdStrSize = 0;
|
cmdStrSize = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,3 +57,9 @@ void timer_start(TimerId timerId, uint16_t count)
|
|||||||
exitCritial();
|
exitCritial();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void timer_stop(TimerId timerId)
|
||||||
|
{
|
||||||
|
enterCritical();
|
||||||
|
user_timer[timerId].isRunning = 0;
|
||||||
|
exitCritial();
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ typedef enum _eTimerId
|
|||||||
|
|
||||||
typedef struct _sTimer_t
|
typedef struct _sTimer_t
|
||||||
{
|
{
|
||||||
int isRunning;
|
volatile int isRunning;
|
||||||
uint16_t count;
|
volatile uint16_t count;
|
||||||
} Timer_t;
|
} Timer_t;
|
||||||
|
|
||||||
typedef enum _eTimerClockSel
|
typedef enum _eTimerClockSel
|
||||||
@@ -39,4 +39,5 @@ typedef enum _eTimerClockSel
|
|||||||
|
|
||||||
void timer_init(Fifo *pFifo, uint16_t TIMER_RELOAD, TimerClockSel clockSel);
|
void timer_init(Fifo *pFifo, uint16_t TIMER_RELOAD, TimerClockSel clockSel);
|
||||||
void timer_start(TimerId timerId, uint16_t count);
|
void timer_start(TimerId timerId, uint16_t count);
|
||||||
|
void timer_stop(TimerId timerId);
|
||||||
#endif /* TIMER_H_ */
|
#endif /* TIMER_H_ */
|
||||||
Reference in New Issue
Block a user