Bläddra i källkod

Merge branch 'stm32f4xx' of git.shilov.pp.ua:shiva/Accum-Tester into stm32f4xx

Vladimir N. Shilov 2 år sedan
förälder
incheckning
815c66204c
2 ändrade filer med 30 tillägg och 11 borttagningar
  1. 2 1
      board/board_ILI9341.h
  2. 28 10
      src/main.c

+ 2 - 1
board/board_ILI9341.h

@@ -123,7 +123,8 @@ static GFXINLINE void write_index(GDisplay *g, gU16 index) {
 
 static GFXINLINE void write_data(GDisplay *g, gU16 data) {
   (void) g;
-  GDISP_RAM = (data | (data<<8));
+  //GDISP_RAM = (data | (data<<8));
+  GDISP_RAM = data;
 }
 
 static GFXINLINE void setreadmode(GDisplay *g) {

+ 28 - 10
src/main.c

@@ -235,16 +235,16 @@ static THD_FUNCTION(Thread1, arg) {
 
     case Decharge:
       palClearLine(LINE_LED1);
-      chThdSleepMilliseconds(700);
+      chThdSleepMilliseconds(900);
       palSetLine(LINE_LED1);
-      chThdSleepMilliseconds(300);
+      chThdSleepMilliseconds(100);
       break;
 
     default:
       palClearLine(LINE_LED1);
-      chThdSleepMilliseconds(300);
+      chThdSleepMilliseconds(100);
       palSetLine(LINE_LED1);
-      chThdSleepMilliseconds(700);
+      chThdSleepMilliseconds(900);
       break;
     }
   }
@@ -470,6 +470,14 @@ int main(void) {
         Timer.mm = tmp0 % 60;
 
         gwinPrintf(GW1, "Pause after Charge_1\n");
+        tmp0 = (Capacity_I + 1800) / 3600;
+        tmp1 = tmp0 / 1000;
+        tmp2 = (tmp0 % 1000) / 10;
+        gwinPrintf(GW1, "CI/CP: %2u.%02u", tmp1, tmp2);
+        tmp0 = (Capacity_P + 1800) / 3600;
+        tmp1 = tmp0 / 1000;
+        tmp2 = (tmp0 % 1000) / 10;
+        gwinPrintf(GW1, "/%2u.%02u\n", tmp1, tmp2);
         gdispFillStringBox(1, 213, 318, 29, "Pause 1", font2, Red, Silver, gJustifyCenter);
         chVTSet(&mode_vt, CHRGR_PAUSE1_S, mode_vt_cb, (void *)Decharge);
         break;
@@ -496,18 +504,20 @@ int main(void) {
         dech_Capacity_P = Capacity_P;
         dechTimer = Timer;
 
-        tmp0 = (Capacity_I + 1800) / 3600;
-        tmp1 = tmp0 / 1000;
-        tmp2 = tmp0 % 1000;
-        chsnprintf(buf, 15, "CI:%2d.%03uAh\n", tmp1, tmp2);
-        gwinPrintf(GW1, buf);
-
         tmp0 = CHRGR_PAUSE2_S / 60;
         Timer.ss = CHRGR_PAUSE2_S % 60;
         Timer.hh = tmp0 / 60;
         Timer.mm = tmp0 % 60;
 
         gwinPrintf(GW1, "Pause after Decharge\n");
+        tmp0 = (Capacity_I + 1800) / 3600;
+        tmp1 = tmp0 / 1000;
+        tmp2 = (tmp0 % 1000) / 10;
+        gwinPrintf(GW1, "CI/CP: %2u.%02u", tmp1, tmp2);
+        tmp0 = (Capacity_P + 1800) / 3600;
+        tmp1 = tmp0 / 1000;
+        tmp2 = (tmp0 % 1000) / 10;
+        gwinPrintf(GW1, "/%2u.%02u\n", tmp1, tmp2);
         gdispFillStringBox(1, 213, 318, 29, "Pause 2", font2, Red, Silver, gJustifyCenter);
         chVTSet(&mode_vt, CHRGR_PAUSE2_S, mode_vt_cb, (void *)Charge2);
         break;
@@ -538,6 +548,14 @@ int main(void) {
           ch_Capacity_I = Capacity_I;
           ch_Capacity_P = Capacity_P;
           chTimer = Timer;
+          tmp0 = (Capacity_I + 1800) / 3600;
+          tmp1 = tmp0 / 1000;
+          tmp2 = (tmp0 % 1000) / 10;
+          gwinPrintf(GW1, "CI/CP: %2u.%02u", tmp1, tmp2);
+          tmp0 = (Capacity_P + 1800) / 3600;
+          tmp1 = tmp0 / 1000;
+          tmp2 = (tmp0 % 1000) / 10;
+          gwinPrintf(GW1, "/%2u.%02u\n", tmp1, tmp2);
         }
         oldState = Stop;
         // power and load relay off