X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/1cca029c8d64a4c55cc146c331c41f04735c7c8f..51243f56fd37dd5b24cbd15e22c8a48bdc4ee41f:/badge/main.c diff --git a/badge/main.c b/badge/main.c index cb7966b..be4ad7a 100644 --- a/badge/main.c +++ b/badge/main.c @@ -57,6 +57,7 @@ #include "ui/display.h" #include "ui/sprite.h" #include "ui/event.h" +#include "ui/font.h" #include "util/util.h" #include "jumpnrun/jumpnrun.h" @@ -65,6 +66,7 @@ #include "drivers/fatfs/ff.h" #include "badge/pinconfig.h" +#include #ifdef R0KET @@ -126,7 +128,7 @@ void rbInit() { { RB_PWR_CHRG, &RB_PWR_CHRG_IO, gpioPullupMode_PullUp } #endif }; - + for(int i = 0; i < ARRAY_SIZE(input_pins); ++i) { gpioSetDir(input_pins[i].port, input_pins[i].pin, gpioDirection_Input); gpioSetPullup(input_pins[i].reg, input_pins[i].mode); @@ -203,31 +205,32 @@ int main(void) badge_init(); #endif -#ifdef HOB_REV2 - gpioSetValue(HOB_PORT(HOB_LED_LEFT), HOB_PIN(HOB_LED_LEFT), 1); - systickDelay(1000); - gpioSetValue(HOB_PORT(HOB_LED_RIGHT), HOB_PIN(HOB_LED_RIGHT), 1); -#endif + /* + nrf_init(); - { - // f_mkfs(0, 1, 0); - badge_framebuffer fb; - int res = 0; - FATFS fatvol; + for(uint8_t i = 1; ; ++i) { + badge_framebuffer fb = { { { 0 } } }; - while(FR_OK != f_mount(0, &fatvol)) { - f_mkfs(0, 1, 0); + fb.data[2][86] = 0xff; + fb.data[3][87] = nrf_read_reg(R_CONFIG); + fb.data[4][86] = 0xff; + for(uint8_t j = 0; j < i; j += 3) { + fb.data[3][j / 3] = 0xff; } - FIL fil; - if(FR_OK == (res = f_open(&fil, "sshot.dat", FA_OPEN_EXISTING | FA_READ))) { - UINT readbytes; + SCB_CLKOUTCLKDIV = i; + badge_framebuffer_flush(&fb); + systickDelay(200); + } + */ - if(FR_OK != f_read(&fil, &fb, sizeof(fb), &readbytes)) { - } + FATFS fs; + f_mount(0, &fs); - f_close(&fil); - } + { + badge_framebuffer fb = { { { 0 } } }; + + fb.data[0][0] = badge_framebuffer_render_text(&fb, 2, 10, "foobar"); badge_framebuffer_flush(&fb); }