/* * Application entry point. */ int main(void) { #if 0 static const evhandler_t evhndl[] = { InsertHandler, RemoveHandler }; #endif /* * System initializations. * - HAL initialization, this also initializes the configured device drivers * and performs the board-specific initializations. * - Kernel initialization, the main() function becomes a thread and the * RTOS is active. */ halInit(); chSysInit(); crypto_init(); buttons_init(); chHeapInit(fast_heap, FAST_HEAP_ADDR, FAST_HEAP_SIZE); sdStart(&SD2, NULL); palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7)); palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7)); lcd_init(); setvbuf(stdin, NULL, _IONBF, 0); mmcObjectInit(&MMCD1); mmcStart(&MMCD1, &mmccfg); mount_card(); pwmStart(&PWMD1, &lcd_pwmcfg); palSetPadMode(GPIOA, 8, PAL_MODE_ALTERNATE(1)); // XXX moveme palSetPadMode(GPIOB, 6, PAL_MODE_INPUT_PULLUP); palSetPadMode(GPIOB, 15, PAL_MODE_INPUT_PULLUP); palSetPadMode(GPIOB, 14, PAL_MODE_INPUT_PULLUP); palSetPadMode(GPIOC, 10, PAL_MODE_INPUT_PULLUP); palSetPadMode(GPIOC, 11, PAL_MODE_INPUT_PULLUP); fiprintf(lcd_stdout, "HIHI"); while (TRUE) { console_cmd_loop(); //chEvtDispatch(evhndl, chEvtWaitOne(ALL_EVENTS)); } return 0; }
static void heap1_setup(void) { chHeapInit(&test_heap, test.buffer, sizeof(union test_buffers)); }
static void dyn1_setup(void) { chHeapInit(&heap1, test.buffer, sizeof(union test_buffers)); }