|
@@ -31,40 +31,49 @@ typedef struct {
|
|
*/
|
|
*/
|
|
const table_state_t stateTable[] = {
|
|
const table_state_t stateTable[] = {
|
|
/* STATE EVENT NEXT STATE STATE_FUNC1 STATE_FUNC2 */
|
|
/* STATE EVENT NEXT STATE STATE_FUNC1 STATE_FUNC2 */
|
|
- /* show date, time */
|
|
|
|
- {stShowTime, evBTN1Pressed, stShowWDay, showWD, NULL},
|
|
|
|
- {stShowWDay, evBTN1Pressed, stShowDM, showDayMon, NULL},
|
|
|
|
- {stShowDM, evBTN1Pressed, stShowYear, showYear, NULL},
|
|
|
|
- {stShowYear, evBTN1Pressed, stShowTime, showTime, NULL},
|
|
|
|
|
|
+ /* show date, time, ... */
|
|
|
|
+ // 'Select' Button pressed
|
|
|
|
+ {stShowTime, evBTN1Pressed, stShowWDay, showWD, NULL},
|
|
|
|
+ {stShowWDay, evBTN1Pressed, stShowDM, showDayMon, NULL},
|
|
|
|
+ {stShowDM, evBTN1Pressed, stShowYear, showYear, NULL},
|
|
|
|
+ {stShowYear, evBTN1Pressed, stShowDNhours, showDNhour, NULL},
|
|
|
|
+ {stShowDNhours, evBTN1Pressed, stShowDNbright, showDNbright, NULL},
|
|
|
|
+ {stShowDNbright, evBTN1Pressed, stShowDNmode, showDNmode, NULL},
|
|
|
|
+ {stShowDNmode, evBTN1Pressed, stShowDNcolour, showDNcolour, NULL},
|
|
|
|
+ {stShowDNcolour, evBTN1Pressed, stShowTime, showTime, NULL},
|
|
|
|
+ // '+' Button pressed
|
|
{stShowTime, evBTN2Pressed, stShowMMSS, showMMSS, NULL},
|
|
{stShowTime, evBTN2Pressed, stShowMMSS, showMMSS, NULL},
|
|
{stShowMMSS, evBTN2Pressed, stShowTime, showTime, NULL},
|
|
{stShowMMSS, evBTN2Pressed, stShowTime, showTime, NULL},
|
|
- {stShowTime, evBTN4Pressed, stShowSensorData, showSensorData, NULL},
|
|
|
|
- {stShowSensorData, evBTN4Pressed, stShowTime, showTime, NULL},
|
|
|
|
|
|
+ // Top Buton pressed
|
|
|
|
+ {stShowTime, evBTN4Pressed, stShowTemperature, showTemperature, NULL},
|
|
|
|
+ {stShowTemperature, evBTN4Pressed, stShowHumidity, showHumidity, NULL},
|
|
|
|
+ {stShowHumidity, evBTN4Pressed, stShowPressure, showPressure, NULL},
|
|
|
|
+ {stShowPressure, evBTN4Pressed, stShowTime, showTime, NULL},
|
|
|
|
|
|
- /* display wdt */
|
|
|
|
|
|
+ /* display wdt events */
|
|
{stShowWDay, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowWDay, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowDM, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowDM, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowYear, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowYear, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowHumidity, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowHumidity, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowTemperature, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowTemperature, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowPressure, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stShowPressure, evDisplayWDT, stShowTime, showTime, NULL},
|
|
- //{stShowBright, evDisplayWDT, stShowTime, showTime, NULL},
|
|
|
|
|
|
+ {stShowDNhours, evDisplayWDT, stShowTime, showTime, NULL},
|
|
|
|
+ {stShowDNbright, evDisplayWDT, stShowTime, showTime, NULL},
|
|
|
|
+ {stShowDNmode, evDisplayWDT, stShowTime, showTime, NULL},
|
|
|
|
+ {stShowDNcolour, evDisplayWDT, stShowTime, showTime, NULL},
|
|
|
|
|
|
/* refresh output */
|
|
/* refresh output */
|
|
{stShowTime, evNewSecond, stNoChange, showTime, NULL},
|
|
{stShowTime, evNewSecond, stNoChange, showTime, NULL},
|
|
{stShowMMSS, evNewSecond, stNoChange, showMMSS, NULL},
|
|
{stShowMMSS, evNewSecond, stNoChange, showMMSS, NULL},
|
|
-// {stShowWDay, evRefreshCal, stNoChange, showWD, NULL},
|
|
|
|
-// {stShowDM, evRefreshCal, stNoChange, showDayMon, NULL},
|
|
|
|
-// {stShowYear, evRefreshCal, stNoChange, showYear, NULL},
|
|
|
|
-// {stShowYear, evBTN1Pressed, stShowBright, showBright, NULL},
|
|
|
|
-// {stShowBright, evBTN1Pressed, stShowTime, showTime, NULL},
|
|
|
|
|
|
|
|
/* set time */
|
|
/* set time */
|
|
{stShowTime, evBTN1Holded, stSetHH, setTimeBegin, setHHBegin},
|
|
{stShowTime, evBTN1Holded, stSetHH, setTimeBegin, setHHBegin},
|
|
{stSetHH, evBTN1Holded, stShowTime, setTimeEnd, showTime},
|
|
{stSetHH, evBTN1Holded, stShowTime, setTimeEnd, showTime},
|
|
{stSetMM, evBTN1Holded, stShowTime, setTimeEnd, showTime},
|
|
{stSetMM, evBTN1Holded, stShowTime, setTimeEnd, showTime},
|
|
|
|
+
|
|
{stSetHH, evBTN1Pressed, stSetMM, setMMBegin, NULL},
|
|
{stSetHH, evBTN1Pressed, stSetMM, setMMBegin, NULL},
|
|
{stSetMM, evBTN1Pressed, stSetHH, setHHBegin, NULL},
|
|
{stSetMM, evBTN1Pressed, stSetHH, setHHBegin, NULL},
|
|
|
|
+
|
|
{stSetHH, evBTN2Pressed, stNoChange, setHHInc, setTimeShow},
|
|
{stSetHH, evBTN2Pressed, stNoChange, setHHInc, setTimeShow},
|
|
{stSetHH, evBTN3Pressed, stNoChange, setHHDec, setTimeShow},
|
|
{stSetHH, evBTN3Pressed, stNoChange, setHHDec, setTimeShow},
|
|
{stSetMM, evBTN2Pressed, stNoChange, setMMInc, setTimeShow},
|
|
{stSetMM, evBTN2Pressed, stNoChange, setMMInc, setTimeShow},
|
|
@@ -103,9 +112,57 @@ const table_state_t stateTable[] = {
|
|
{stSetMon, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stSetMon, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stSetYear, evDisplayWDT, stShowTime, showTime, NULL},
|
|
{stSetYear, evDisplayWDT, stShowTime, showTime, NULL},
|
|
|
|
|
|
- /* set bright */
|
|
|
|
-// {stShowBright, evBTN3Pressed, stNoChange, incBright, showBright},
|
|
|
|
-// {stShowBright, evBTN2Pressed, stNoChange, decBright, showBright},
|
|
|
|
|
|
+ /* set lighting */
|
|
|
|
+ // begin
|
|
|
|
+ {stShowDNhours, evBTN1Holded, stSetDayHour, setDNbegin, setDayHourBegin},
|
|
|
|
+ {stShowDNbright, evBTN1Holded, stSetDayBright, setDNbegin, setDayBrightBegin},
|
|
|
|
+ {stShowDNmode, evBTN1Holded, stSetDayMode, setDNbegin, setDayModeBegin},
|
|
|
|
+ {stShowDNcolour, evBTN1Holded, stSetDayColour, setDNbegin, setDayColourBegin},
|
|
|
|
+ // end
|
|
|
|
+ {stSetDayHour, evBTN1Holded, stShowDNhours, setDNend, showDNhour},
|
|
|
|
+ {stSetNightHour, evBTN1Holded, stShowDNhours, setDNend, showDNhour},
|
|
|
|
+ {stSetDayBright, evBTN1Holded, stShowDNbright, setDNend, showDNbright},
|
|
|
|
+ {stSetNightBright, evBTN1Holded, stShowDNbright, setDNend, showDNbright},
|
|
|
|
+ {stSetDayMode, evBTN1Holded, stShowDNmode, setDNend, showDNmode},
|
|
|
|
+ {stSetNightMode, evBTN1Holded, stShowDNmode, setDNend, showDNmode},
|
|
|
|
+ {stSetDayColour, evBTN1Holded, stShowDNcolour, setDNend, showDNcolour},
|
|
|
|
+ {stSetNightColour, evBTN1Holded, stShowDNcolour, setDNend, showDNcolour},
|
|
|
|
+ // next
|
|
|
|
+ {stSetDayHour, evBTN1Pressed, stSetNightHour, setNightHourBegin, NULL},
|
|
|
|
+ {stSetNightHour, evBTN1Pressed, stSetDayBright, setDayBrightBegin, NULL},
|
|
|
|
+ {stSetDayBright, evBTN1Pressed, stSetNightBright, setNightBrightBegin, NULL},
|
|
|
|
+ {stSetNightBright, evBTN1Pressed, stSetDayMode, setDayModeBegin, NULL},
|
|
|
|
+ {stSetDayMode, evBTN1Pressed, stSetNightMode, setNightModeBegin, NULL},
|
|
|
|
+ {stSetNightMode, evBTN1Pressed, stSetDayColour, setDayColourBegin, NULL},
|
|
|
|
+ {stSetDayColour, evBTN1Pressed, stSetNightColour, setNightColourBegin, NULL},
|
|
|
|
+ {stSetNightColour, evBTN1Pressed, stSetDayHour, setDayHourBegin, NULL},
|
|
|
|
+ // change
|
|
|
|
+ {stSetDayHour, evBTN2Pressed, stNoChange, setIncDayHour, showDNhour},
|
|
|
|
+ {stSetDayHour, evBTN3Pressed, stNoChange, setDecDayHour, showDNhour},
|
|
|
|
+ {stSetNightHour, evBTN2Pressed, stNoChange, setIncNightHour, showDNhour},
|
|
|
|
+ {stSetNightHour, evBTN3Pressed, stNoChange, setDecNightHour, showDNhour},
|
|
|
|
+ {stSetDayBright, evBTN2Pressed, stNoChange, setIncDayBright, showDNbright},
|
|
|
|
+ {stSetDayBright, evBTN3Pressed, stNoChange, setDecDayBright, showDNbright},
|
|
|
|
+ {stSetNightBright, evBTN2Pressed, stNoChange, setIncNightBright, showDNbright},
|
|
|
|
+ {stSetNightBright, evBTN3Pressed, stNoChange, setDecNightBright, showDNbright},
|
|
|
|
+ {stSetDayMode, evBTN2Pressed, stNoChange, setIncDayMode, showDNmode},
|
|
|
|
+ {stSetDayMode, evBTN3Pressed, stNoChange, setDecDayMode, showDNmode},
|
|
|
|
+ {stSetNightMode, evBTN2Pressed, stNoChange, setIncNightMode, showDNmode},
|
|
|
|
+ {stSetNightMode, evBTN3Pressed, stNoChange, setDecNightMode, showDNmode},
|
|
|
|
+ {stSetDayColour, evBTN2Pressed, stNoChange, setIncDayColour, showDNcolour},
|
|
|
|
+ {stSetDayColour, evBTN3Pressed, stNoChange, setDecDayColour, showDNcolour},
|
|
|
|
+ {stSetNightColour, evBTN2Pressed, stNoChange, setIncNightColour, showDNcolour},
|
|
|
|
+ {stSetNightColour, evBTN3Pressed, stNoChange, setDecNightColour, showDNcolour},
|
|
|
|
+ // WDT
|
|
|
|
+ {stSetDayHour, evDisplayWDT, stShowTime, setDNbreak, showTime},
|
|
|
|
+ {stSetNightHour, evDisplayWDT, stShowTime, setDNbreak, showTime},
|
|
|
|
+ {stSetDayBright, evDisplayWDT, stShowTime, setDNbreak, showTime},
|
|
|
|
+ {stSetNightBright, evDisplayWDT, stShowTime, setDNbreak, showTime},
|
|
|
|
+ {stSetDayMode, evDisplayWDT, stShowTime, setDNbreak, showTime},
|
|
|
|
+ {stSetNightMode, evDisplayWDT, stShowTime, setDNbreak, showTime},
|
|
|
|
+ {stSetDayColour, evDisplayWDT, stShowTime, setDNbreak, showTime},
|
|
|
|
+ {stSetNightColour, evDisplayWDT, stShowTime, setDNbreak, showTime},
|
|
|
|
+
|
|
/* mandatory empty table row */
|
|
/* mandatory empty table row */
|
|
{stNoChange, eventNull, stNoChange, EmptyFunc, EmptyFunc}
|
|
{stNoChange, eventNull, stNoChange, EmptyFunc, EmptyFunc}
|
|
};
|
|
};
|