|
@@ -18,7 +18,8 @@ static btn_t Button[BTN_NUM] = {
|
|
|
{0, evBTN3Pressed, evBTN3Pressed, BTN3_PIN},
|
|
|
{0, evBTN4Pressed, evBTN4Holded, BTN4_PIN}
|
|
|
};
|
|
|
-static volatile uint8_t dispWDT = 0;
|
|
|
+volatile static uint8_t dispWDT = 0;
|
|
|
+static in15_pin_t symToFade = 0;
|
|
|
|
|
|
/* function prototypes */
|
|
|
//static void Color_RGB(const uint8_t r, const uint8_t g, const uint8_t b);
|
|
@@ -27,8 +28,8 @@ static void MinusFadeOut(void);
|
|
|
static void PlusFadeIn(void);
|
|
|
static void PercentFadeIn(void);
|
|
|
static void PressureFadeIn(void);
|
|
|
-//static void IN15_FadeIn(in15_pin_t pin);
|
|
|
-//static void IN15_FadeOut(in15_pin_t pin);
|
|
|
+static void IN15_FadeIn(void);
|
|
|
+static void IN15_FadeOut(void);
|
|
|
static void valIncrease(uint8_t * val, uint8_t max);
|
|
|
static void valDecrease(uint8_t * val, uint8_t max);
|
|
|
|
|
@@ -234,20 +235,19 @@ static void PressureFadeIn(void) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#ifdef NEW_SHED
|
|
|
-static void IN15_FadeIn(in15_pin_t pin) {
|
|
|
+static void IN15_FadeIn(void) {
|
|
|
static uint8_t on = FADE_START;
|
|
|
static uint8_t off = FADE_STOP;
|
|
|
static uint8_t st = 0;
|
|
|
|
|
|
if (st == 0) {
|
|
|
st = 1;
|
|
|
- GPIOA->BSRR = pin;
|
|
|
+ GPIOA->BSRR = symToFade;
|
|
|
on += FADE_STEP;
|
|
|
if (on < FADE_STOP) {
|
|
|
RTOS_SetTask(IN15_FadeIn, on, 0);
|
|
|
} else {
|
|
|
- on = FADE_START; off = FADE_STOP; st = 0;
|
|
|
+ on = FADE_START; off = FADE_STOP; st = 0; symToFade = 0;
|
|
|
}
|
|
|
} else {
|
|
|
st = 0;
|
|
@@ -257,7 +257,7 @@ static void IN15_FadeIn(in15_pin_t pin) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static void IN15_FadeOut(in15_pin_t pin) {
|
|
|
+static void IN15_FadeOut(void) {
|
|
|
static uint8_t off = FADE_START;
|
|
|
static uint8_t on = FADE_STOP;
|
|
|
static uint8_t st = 0;
|
|
@@ -269,16 +269,15 @@ static void IN15_FadeOut(in15_pin_t pin) {
|
|
|
if (off < FADE_STOP) {
|
|
|
RTOS_SetTask(IN15_FadeOut, off, 0);
|
|
|
} else {
|
|
|
- off = FADE_START; on = FADE_STOP; st = 0;
|
|
|
+ off = FADE_START; on = FADE_STOP; st = 0; symToFade = 0;
|
|
|
}
|
|
|
} else {
|
|
|
st = 0;
|
|
|
- GPIOA->BSRR = pin;
|
|
|
+ GPIOA->BSRR = symToFade;
|
|
|
on -= FADE_STEP;
|
|
|
RTOS_SetTask(IN15_FadeOut, on, 0);
|
|
|
}
|
|
|
}
|
|
|
-#endif /* NewShed */
|
|
|
|
|
|
/**
|
|
|
* Show info on tubes.
|
|
@@ -376,8 +375,9 @@ void showYear(void) {
|
|
|
void showHumidity(void) {
|
|
|
dispWDT = DISP_WDT_TIME;
|
|
|
//in15Percent();
|
|
|
- //IN15_FadeIn(sym_Percent);
|
|
|
- PercentFadeIn();
|
|
|
+ symToFade = sym_Percent;
|
|
|
+ IN15_FadeIn();
|
|
|
+ //PercentFadeIn();
|
|
|
|
|
|
tube4_t buf;
|
|
|
buf.s8.tA = Humidity / 10;
|
|
@@ -390,8 +390,9 @@ void showHumidity(void) {
|
|
|
void showTemperature(void) {
|
|
|
dispWDT = DISP_WDT_TIME;
|
|
|
//in15Plus();
|
|
|
- //IN15_FadeIn(sym_Plus);
|
|
|
- PlusFadeIn();
|
|
|
+ symToFade = sym_Plus;
|
|
|
+ IN15_FadeIn();
|
|
|
+ //PlusFadeIn();
|
|
|
|
|
|
tube4_t buf;
|
|
|
buf.s8.tA = 0xf;
|
|
@@ -404,8 +405,9 @@ void showTemperature(void) {
|
|
|
void showPressure(void) {
|
|
|
dispWDT = DISP_WDT_TIME;
|
|
|
//in15P();
|
|
|
- //IN15_FadeIn(sym_Pressure);
|
|
|
- PressureFadeIn();
|
|
|
+ symToFade = sym_Pressure;
|
|
|
+ IN15_FadeIn();
|
|
|
+ //PressureFadeIn();
|
|
|
|
|
|
tube4_t buf;
|
|
|
int tmp;
|
|
@@ -514,6 +516,75 @@ void setTimeEnd(void) {
|
|
|
RTC_ReadAll(&Clock);
|
|
|
}
|
|
|
|
|
|
+void setDateBegin(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setDateEnd(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setWShow(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setDMShow(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setYearShow(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setWDayBegin(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setMDayBegin(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setMonthBegin(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setYearBegin(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setIncWDay(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setIncMDay(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setIncMonth(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setIncYear(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setDecWDay(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setDecMDay(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setDecMonth(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void setDecYear(void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* @brief Increase BCD value.
|
|
|
* @param : val, max
|