本文整理汇总了C++中TimeValue::DecreaseMinute方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeValue::DecreaseMinute方法的具体用法?C++ TimeValue::DecreaseMinute怎么用?C++ TimeValue::DecreaseMinute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeValue
的用法示例。
在下文中一共展示了TimeValue::DecreaseMinute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessKey
void ProcessKey()
{
if (current_key != KEY_NONE)
{
switch (current_key)
{
case KEY_TIMER_PRESET:
{
if(countDownTimerState == COUNT_DOWN_TIMER_STATE_STOPPED)
{
sevenSegmentDisplay.SetStandBy(false);
timeValue.Reset();
if (preset_idx == sizeof(preset_time)/sizeof(uint8_t))
{
preset_idx = 0;
}
for (int i = 0; i < preset_time[preset_idx]; i++)
{
timeValue.IncreaseMinute();
}
sevenSegmentDisplay.SetTime(timeValue);
preset_idx++;
}
}
break;
case KEY_START_STOP:
{
/*
* If already stopped then start it
**/
if (countDownTimerState == COUNT_DOWN_TIMER_STATE_STOPPED)
{
StartCountDownTimer();
}
else if(countDownTimerState == COUNT_DOWN_TIMER_STATE_STARTED)
{
/*
* If already started then stop it
**/
StopCountDownTimer();
}
}
break;
case KEY_TIMER_UP:
{
if(countDownTimerState == COUNT_DOWN_TIMER_STATE_STOPPED)
{
sevenSegmentDisplay.SetStandBy(false);
if (minuteSelect == true)
{
timeValue.IncreaseMinute();
}
else
{
for (unsigned char i = 0; i < 10; i++)
{
timeValue.IncreaseSecond();
}
}
sevenSegmentDisplay.SetTime(timeValue);
}
}
break;
case KEY_TIMER_DOWN:
{
if(countDownTimerState == COUNT_DOWN_TIMER_STATE_STOPPED)
{
sevenSegmentDisplay.SetStandBy(false);
if (minuteSelect == true)
{
timeValue.DecreaseMinute();
}
else
{
/* increase second in multiples of 10*/
for (unsigned char i = 0; i < 10; i++)
{
timeValue.DecreaseSecond();
}
}
sevenSegmentDisplay.SetTime(timeValue);
}
}
break;
case KEY_TIMER_MINUTE_SELECT:
{
if(countDownTimerState == COUNT_DOWN_TIMER_STATE_STOPPED)
{
minuteSelect = !minuteSelect;
}
}
//.........这里部分代码省略.........