CLKDIV-Durchlauf für Sync zum Messen.
[hackover2013-badge-firmware.git] / badge / main.c
index 99ecee2..5f7fde3 100644 (file)
@@ -64,6 +64,8 @@
 
 #include "drivers/fatfs/ff.h"
 
+#include "badge/pinconfig.h"
+
 #ifdef R0KET
 
 #include "r0ketports.h"
@@ -104,6 +106,16 @@ void rbInit() {
     uint32_t volatile *reg;
     gpioPullupMode_t mode;
   } const input_pins[] = {
+#ifdef HOB_REV2
+    { RB_BTN0    , &RB_BTN0_IO    , gpioPullupMode_PullDown },
+    { RB_BTN1    , &RB_BTN1_IO    , gpioPullupMode_PullDown },
+    { RB_BTN2    , &RB_BTN2_IO    , gpioPullupMode_PullDown },
+    { RB_BTN3    , &RB_BTN3_IO    , gpioPullupMode_PullDown },
+    { RB_BTN4    , &RB_BTN4_IO    , gpioPullupMode_PullDown },
+    { RB_HB0     , &RB_HB0_IO     , gpioPullupMode_PullDown },
+    { RB_HB1     , &RB_HB1_IO     , gpioPullupMode_PullDown },
+    { RB_PWR_CHRG, &RB_PWR_CHRG_IO, gpioPullupMode_PullDown }
+#else
     { RB_BTN0    , &RB_BTN0_IO    , gpioPullupMode_PullUp },
     { RB_BTN1    , &RB_BTN1_IO    , gpioPullupMode_PullUp },
     { RB_BTN2    , &RB_BTN2_IO    , gpioPullupMode_PullUp },
@@ -112,6 +124,7 @@ void rbInit() {
     { RB_HB0     , &RB_HB0_IO     , gpioPullupMode_PullUp },
     { RB_HB1     , &RB_HB1_IO     , gpioPullupMode_PullUp },
     { RB_PWR_CHRG, &RB_PWR_CHRG_IO, gpioPullupMode_PullUp }
+#endif
   };
     
   for(int i = 0; i < ARRAY_SIZE(input_pins); ++i) {
@@ -190,7 +203,20 @@ int main(void)
   badge_init();
 #endif
 
-  /*
+  for(uint8_t i = 1; ; ++i) {
+    badge_framebuffer fb = { { { 0 } } };
+
+    fb.data[2][86] = 0xff;
+    fb.data[4][86] = 0xff;
+    for(uint8_t j = 0; j < i; j += 3) {
+      fb.data[3][j / 3] = 0xff;
+    }
+
+    SCB_CLKOUTCLKDIV = i;
+    badge_framebuffer_flush(&fb);
+    systickDelay(200);
+  }
+
   {
     //    f_mkfs(0, 1, 0);
     badge_framebuffer fb;
@@ -212,22 +238,20 @@ int main(void)
     }
 
     badge_framebuffer_flush(&fb);
-
   }
 
-  usbMSCInit();
-  for(;;);
-  */
+  if(badge_input_raw() & BADGE_EVENT_KEY_DOWN) {
+    usbMSCInit();
+    for(;;);
+  }
 
   badge_event_start();
 
-  /*
   for(;;) {
     if(JUMPNRUN_ERROR == jumpnrun_play("smb.lvl")) {
       break;
     }
   }
-  */
 
   uint8_t buttons = 0;
 
This page took 0.024911 seconds and 4 git commands to generate.