|
@@ -29,8 +29,8 @@
|
|
#define INA_SCAN_PERIOS_US 62500
|
|
#define INA_SCAN_PERIOS_US 62500
|
|
#define INA_AVG_FACTOR 16
|
|
#define INA_AVG_FACTOR 16
|
|
|
|
|
|
-#define CHRGR_PAUSE1_S 300
|
|
|
|
-#define CHRGR_PAUSE2_S 300
|
|
|
|
|
|
+#define CHRGR_PAUSE1_S 60
|
|
|
|
+#define CHRGR_PAUSE2_S 60
|
|
|
|
|
|
#define INA_ALL_VALUSE EVENT_MASK(0)
|
|
#define INA_ALL_VALUSE EVENT_MASK(0)
|
|
#define INA_BUS_VALUES EVENT_MASK(1)
|
|
#define INA_BUS_VALUES EVENT_MASK(1)
|
|
@@ -431,24 +431,22 @@ int main(void) {
|
|
chsnprintf(buf, 11, "I:%2d.%03u A", tmp1, tmp2);
|
|
chsnprintf(buf, 11, "I:%2d.%03u A", tmp1, tmp2);
|
|
gdispFillStringBox(0, MENU_LINE_4, MENU_LINE_W, MENU_LINE_H, buf, font2, Red, Gray, gJustifyLeft);
|
|
gdispFillStringBox(0, MENU_LINE_4, MENU_LINE_W, MENU_LINE_H, buf, font2, Red, Gray, gJustifyLeft);
|
|
|
|
|
|
- /*
|
|
|
|
tmp1 = Power / 1000;
|
|
tmp1 = Power / 1000;
|
|
tmp2 = Power % 1000;
|
|
tmp2 = Power % 1000;
|
|
chsnprintf(buf, 11, "P:%2d.%03uW", tmp1, tmp2);
|
|
chsnprintf(buf, 11, "P:%2d.%03uW", tmp1, tmp2);
|
|
- gdispFillStringBox(1, 183, 158, 29, buf, font2, Red, Gray, gJustifyLeft);
|
|
|
|
- */
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_5, MENU_LINE_W, MENU_LINE_H, buf, font2, Red, Gray, gJustifyLeft);
|
|
|
|
|
|
tmp0 = (Capacity_I + 1800) / 3600;
|
|
tmp0 = (Capacity_I + 1800) / 3600;
|
|
tmp1 = tmp0 / 1000;
|
|
tmp1 = tmp0 / 1000;
|
|
tmp2 = (tmp0 % 1000) / 10;
|
|
tmp2 = (tmp0 % 1000) / 10;
|
|
chsnprintf(buf, 13, "CI:%2d.%02u AH", tmp1, tmp2);
|
|
chsnprintf(buf, 13, "CI:%2d.%02u AH", tmp1, tmp2);
|
|
- gdispFillStringBox(0, MENU_LINE_5, MENU_LINE_W, MENU_LINE_H, buf, font2, Red, Gray, gJustifyLeft);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_6, MENU_LINE_W, MENU_LINE_H, buf, font2, Red, Gray, gJustifyLeft);
|
|
|
|
|
|
tmp0 = (Capacity_P + 1800) / 3600;
|
|
tmp0 = (Capacity_P + 1800) / 3600;
|
|
tmp1 = tmp0 / 1000;
|
|
tmp1 = tmp0 / 1000;
|
|
tmp2 = (tmp0 % 1000) / 100;
|
|
tmp2 = (tmp0 % 1000) / 100;
|
|
chsnprintf(buf, 13, "CP:%2d.%1u WH", tmp1, tmp2);
|
|
chsnprintf(buf, 13, "CP:%2d.%1u WH", tmp1, tmp2);
|
|
- gdispFillStringBox(0, MENU_LINE_6, MENU_LINE_W, MENU_LINE_H, buf, font2, Red, Gray, gJustifyLeft);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_7, MENU_LINE_W, MENU_LINE_H, buf, font2, Red, Gray, gJustifyLeft);
|
|
|
|
|
|
graph_Draw(Voltage, Current);
|
|
graph_Draw(Voltage, Current);
|
|
|
|
|
|
@@ -505,7 +503,7 @@ int main(void) {
|
|
gwinPrintf(GW1, "No Battery detected / Low voltage...\n");
|
|
gwinPrintf(GW1, "No Battery detected / Low voltage...\n");
|
|
charger_State = Stop;
|
|
charger_State = Stop;
|
|
show_MenuItem(MenuItem_4);
|
|
show_MenuItem(MenuItem_4);
|
|
- gdispFillStringBox(0, MENU_LINE_8, MENU_LINE_W, MENU_LINE_H, "Stop", font2, Red, Silver, gJustifyCenter);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_2, MENU_LINE_W, MENU_LINE_H, "Stop", font2, Red, Silver, gJustifyCenter);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
oldState = Charge1;
|
|
oldState = Charge1;
|
|
@@ -517,7 +515,7 @@ int main(void) {
|
|
gwinPrintf(GW1, "Begin process: Charge_1\n");
|
|
gwinPrintf(GW1, "Begin process: Charge_1\n");
|
|
|
|
|
|
palClearLine(LINE_RELAY1); // power relay on
|
|
palClearLine(LINE_RELAY1); // power relay on
|
|
- gdispFillStringBox(0, MENU_LINE_8, MENU_LINE_W, MENU_LINE_H, "Charge 1", font2, Red, Silver, gJustifyCenter);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_2, MENU_LINE_W, MENU_LINE_H, "Charge 1", font2, Red, Silver, gJustifyCenter);
|
|
break;
|
|
break;
|
|
|
|
|
|
case Pause1:
|
|
case Pause1:
|
|
@@ -541,7 +539,7 @@ int main(void) {
|
|
|
|
|
|
gwinPrintf(GW1, "Pause after Charge_1\n");
|
|
gwinPrintf(GW1, "Pause after Charge_1\n");
|
|
|
|
|
|
- gdispFillStringBox(0, MENU_LINE_8, MENU_LINE_W, MENU_LINE_H, "Pause 1", font2, Red, Silver, gJustifyCenter);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_2, MENU_LINE_W, MENU_LINE_H, "Pause 1", font2, Red, Silver, gJustifyCenter);
|
|
chVTSet(&mode_vt, TIME_S2I(CHRGR_PAUSE1_S), mode_vt_cb, (void *)Decharge);
|
|
chVTSet(&mode_vt, TIME_S2I(CHRGR_PAUSE1_S), mode_vt_cb, (void *)Decharge);
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -555,7 +553,7 @@ int main(void) {
|
|
gwinPrintf(GW1, "Begin process: Decharge\n");
|
|
gwinPrintf(GW1, "Begin process: Decharge\n");
|
|
|
|
|
|
palClearLine(LINE_RELAY2); // load relay on
|
|
palClearLine(LINE_RELAY2); // load relay on
|
|
- gdispFillStringBox(0, MENU_LINE_8, MENU_LINE_W, MENU_LINE_H, "Decharge", font2, Red, Silver, gJustifyCenter);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_2, MENU_LINE_W, MENU_LINE_H, "Decharge", font2, Red, Silver, gJustifyCenter);
|
|
break;
|
|
break;
|
|
|
|
|
|
case Pause2:
|
|
case Pause2:
|
|
@@ -582,7 +580,7 @@ int main(void) {
|
|
gwinPrintf(GW1, "/%2u.%02u\n", tmp1, tmp2);
|
|
gwinPrintf(GW1, "/%2u.%02u\n", tmp1, tmp2);
|
|
|
|
|
|
gwinPrintf(GW1, "Pause after Decharge\n");
|
|
gwinPrintf(GW1, "Pause after Decharge\n");
|
|
- gdispFillStringBox(0, MENU_LINE_8, MENU_LINE_W, MENU_LINE_H, "Pause 2", font2, Red, Silver, gJustifyCenter);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_2, MENU_LINE_W, MENU_LINE_H, "Pause 2", font2, Red, Silver, gJustifyCenter);
|
|
|
|
|
|
chVTSet(&mode_vt, TIME_S2I(CHRGR_PAUSE2_S), mode_vt_cb, (void *)Charge2);
|
|
chVTSet(&mode_vt, TIME_S2I(CHRGR_PAUSE2_S), mode_vt_cb, (void *)Charge2);
|
|
break;
|
|
break;
|
|
@@ -597,7 +595,7 @@ int main(void) {
|
|
gwinPrintf(GW1, "Begin process: Charge_2\n");
|
|
gwinPrintf(GW1, "Begin process: Charge_2\n");
|
|
|
|
|
|
palClearLine(LINE_RELAY1); // power relay on
|
|
palClearLine(LINE_RELAY1); // power relay on
|
|
- gdispFillStringBox(0, MENU_LINE_8, MENU_LINE_W, MENU_LINE_H, "Charge 2", font2, Red, Silver, gJustifyCenter);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_2, MENU_LINE_W, MENU_LINE_H, "Charge 2", font2, Red, Silver, gJustifyCenter);
|
|
break;
|
|
break;
|
|
|
|
|
|
case Error:
|
|
case Error:
|
|
@@ -606,7 +604,7 @@ int main(void) {
|
|
palSetLine(LINE_RELAY1);
|
|
palSetLine(LINE_RELAY1);
|
|
palSetLine(LINE_RELAY2);
|
|
palSetLine(LINE_RELAY2);
|
|
gwinPrintf(GW1, "ERROR\n");
|
|
gwinPrintf(GW1, "ERROR\n");
|
|
- gdispFillStringBox(0, MENU_LINE_8, MENU_LINE_W, MENU_LINE_H, "Error", font2, Silver, Red, gJustifyCenter);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_2, MENU_LINE_W, MENU_LINE_H, "Error", font2, Silver, Red, gJustifyCenter);
|
|
break;
|
|
break;
|
|
|
|
|
|
default:
|
|
default:
|
|
@@ -632,14 +630,14 @@ int main(void) {
|
|
palSetLine(LINE_RELAY1);
|
|
palSetLine(LINE_RELAY1);
|
|
palSetLine(LINE_RELAY2);
|
|
palSetLine(LINE_RELAY2);
|
|
gwinPrintf(GW1, "STOP\n");
|
|
gwinPrintf(GW1, "STOP\n");
|
|
- gdispFillStringBox(0, MENU_LINE_8, MENU_LINE_W, MENU_LINE_H, "Stop", font2, Red, Silver, gJustifyCenter);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_2, MENU_LINE_W, MENU_LINE_H, "Stop", font2, Red, Silver, gJustifyCenter);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (events & TIME_CHANGE) {
|
|
if (events & TIME_CHANGE) {
|
|
chsnprintf(buf, 12, "T: %02u:%02u:%02u", Timer.hh, Timer.mm, Timer.ss);
|
|
chsnprintf(buf, 12, "T: %02u:%02u:%02u", Timer.hh, Timer.mm, Timer.ss);
|
|
- gdispFillStringBox(0, MENU_LINE_7, MENU_LINE_W, MENU_LINE_H, buf, font2, Red, Gray, gJustifyLeft);
|
|
|
|
|
|
+ gdispFillStringBox(0, MENU_LINE_8, MENU_LINE_W, MENU_LINE_H, buf, font2, Red, Gray, gJustifyLeft);
|
|
}
|
|
}
|
|
|
|
|
|
if (events & INSERTED_EVENT) {
|
|
if (events & INSERTED_EVENT) {
|
|
@@ -659,7 +657,8 @@ static void prepare_Screen(void) {
|
|
/* Set some fonts */
|
|
/* Set some fonts */
|
|
font1 = gdispOpenFont("DejaVu Sans Book 12");
|
|
font1 = gdispOpenFont("DejaVu Sans Book 12");
|
|
//font2 = gdispOpenFont("DejaVu Sans Book 24");
|
|
//font2 = gdispOpenFont("DejaVu Sans Book 24");
|
|
- font2 = gdispOpenFont("DejaVuSans10");
|
|
|
|
|
|
+ font2 = font1;
|
|
|
|
+ //gdispOpenFont("DejaVuSans10");
|
|
gwinSetDefaultFont(font1);
|
|
gwinSetDefaultFont(font1);
|
|
|
|
|
|
/* draw screen frame */
|
|
/* draw screen frame */
|