Browse Source

Fixed +/- buton reaction.

Vladimir N. Shilov 2 years ago
parent
commit
4b64ecca50
2 changed files with 21 additions and 21 deletions
  1. 4 4
      Src/clock.c
  2. 17 17
      Src/event-system.c

+ 4 - 4
Src/clock.c

@@ -1,7 +1,7 @@
 #include "clock.h"
 
 /* type defs */
-typedef struct {
+typedef struct t_btn {
   uint8_t     time;
   es_event_t  pressed;
   es_event_t  holded;
@@ -310,11 +310,11 @@ static void IN15_FadeOut(void) {
 
 /**
  * @brief  HSV to RGB convertion
- * @param  hue: 0-59, sat: 0-255, val (lightness): 0-255
- * @return none. RGB value out direct to LED.
+ * @param  hue: 0-(6*256)-1 /59/, sat: 0-255, val (lightness): 0-255
+ * @return none. RGB value output direct to LED.
  */
 static void HSV2LED(const uint8_t hue, const uint8_t sat, const uint8_t val) {
-#ifdef TEST-TEST-TEST
+#ifdef TEST_TEST_TEST
   int base;
   uint32_t r=0, g=0, b=0;
 

+ 17 - 17
Src/event-system.c

@@ -45,19 +45,19 @@ const table_state_t stateTable[] = {
   {stShowWDay,        evDisplayWDT, stShowTime, showTime, NULL},
   {stShowDM,          evDisplayWDT, stShowTime, showTime, NULL},
   {stShowYear,        evDisplayWDT, stShowTime, showTime, NULL},
-  //{stShowBright,      evDisplayWDT, stShowTime, showTime, NULL},
   {stShowHumidity,    evDisplayWDT, stShowTime, showTime, NULL},
   {stShowTemperature, evDisplayWDT, stShowTime, showTime, NULL},
   {stShowPressure,    evDisplayWDT, stShowTime, showTime, NULL},
+  //{stShowBright,      evDisplayWDT, stShowTime, showTime, NULL},
 
   /* refresh output */
   {stShowTime, evNewSecond,  stNoChange, showTime,   NULL},
   {stShowMMSS, evNewSecond,  stNoChange, showMMSS,   NULL},
-  {stShowWDay, evRefreshCal, stNoChange, showWD,     NULL},
-  {stShowDM,   evRefreshCal, stNoChange, showDayMon, NULL},
-  {stShowYear, evRefreshCal, stNoChange, showYear,   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},
+//  {stShowBright, evBTN1Pressed, stShowTime,   showTime,   NULL},
 
   /* set time */
   {stShowTime, evBTN1Holded,  stSetHH,    setTimeBegin, setHHBegin},
@@ -65,10 +65,10 @@ const table_state_t stateTable[] = {
   {stSetMM,    evBTN1Holded,  stShowTime, setTimeEnd,   showTime},
   {stSetHH,    evBTN1Pressed, stSetMM,    setMMBegin,   NULL},
   {stSetMM,    evBTN1Pressed, stSetHH,    setHHBegin,   NULL},
-  {stSetHH,    evBTN3Pressed, stNoChange, setHHInc,     setTimeShow},
-  {stSetHH,    evBTN2Pressed, stNoChange, setHHDec,     setTimeShow},
-  {stSetMM,    evBTN3Pressed, stNoChange, setMMInc,     setTimeShow},
-  {stSetMM,    evBTN2Pressed, stNoChange, setMMDec,     setTimeShow},
+  {stSetHH,    evBTN2Pressed, stNoChange, setHHInc,     setTimeShow},
+  {stSetHH,    evBTN3Pressed, stNoChange, setHHDec,     setTimeShow},
+  {stSetMM,    evBTN2Pressed, stNoChange, setMMInc,     setTimeShow},
+  {stSetMM,    evBTN3Pressed, stNoChange, setMMDec,     setTimeShow},
 
   {stSetHH,    evNewSecond,   stNoChange, setTimeShow,  NULL},
   {stSetMM,    evNewSecond,   stNoChange, setTimeShow,  NULL},
@@ -92,14 +92,14 @@ const table_state_t stateTable[] = {
   {stSetMon,  evBTN1Pressed, stSetYear, setYearBegin,  NULL},
   {stSetYear, evBTN1Pressed, stSetWD,   setWDBegin,    NULL},
   // change
-  {stSetWD,   evBTN2Pressed, stNoChange, setDecWDay,  setWDShow},
-  {stSetWD,   evBTN3Pressed, stNoChange, setIncWDay,  setWDShow},
-  {stSetMD,   evBTN2Pressed, stNoChange, setDecMDay,  setDMShow},
-  {stSetMD,   evBTN3Pressed, stNoChange, setIncMDay,  setDMShow},
-  {stSetMon,  evBTN2Pressed, stNoChange, setDecMonth, setDMShow},
-  {stSetMon,  evBTN3Pressed, stNoChange, setIncMonth, setDMShow},
-  {stSetYear, evBTN2Pressed, stNoChange, setDecYear,  setYearShow},
-  {stSetYear, evBTN3Pressed, stNoChange, setIncYear,  setYearShow},
+  {stSetWD,   evBTN2Pressed, stNoChange, setIncWDay,  setWDShow},
+  {stSetWD,   evBTN3Pressed, stNoChange, setDecWDay,  setWDShow},
+  {stSetMD,   evBTN2Pressed, stNoChange, setIncMDay,  setDMShow},
+  {stSetMD,   evBTN3Pressed, stNoChange, setDecMDay,  setDMShow},
+  {stSetMon,  evBTN2Pressed, stNoChange, setIncMonth, setDMShow},
+  {stSetMon,  evBTN3Pressed, stNoChange, setDecMonth, setDMShow},
+  {stSetYear, evBTN2Pressed, stNoChange, setIncYear,  setYearShow},
+  {stSetYear, evBTN3Pressed, stNoChange, setDecYear,  setYearShow},
   // WDT
   {stSetWD,   evDisplayWDT, stShowTime, showTime, NULL},
   {stSetMD,   evDisplayWDT, stShowTime, showTime, NULL},