//{{{void wah_non_leading_union_with_SA_subtract_SE(uint32_t domain, void wah_non_leading_union_with_SA_subtract_SE(uint32_t domain, void **R, void *d) { struct wah_bpt_non_leading_data *nld = (struct wah_bpt_non_leading_data *) d; if (nld != NULL) { if ((nld->SA != NULL)) { uint8_t **w = (uint8_t **)R; if (*w == NULL) *w = wah_init(0); uint8_t *r = NULL; uint32_t r_size = 0; uint32_t resize = wah_or(*w, nld->SA, &r, &r_size); free(*w); *w = r; } if ((nld->SE != NULL)) { uint8_t **w = (uint8_t **)R; if (*w == NULL) *w = wah_init(0); uint8_t *r = NULL; uint32_t r_size = 0; uint32_t resize = wah_nand(*w, nld->SE, &r, &r_size); free(*w); *w = r; } } }
//{{{void wah_uniq_append(uint8_t **w, uint32_t id) void wah_uniq_append(uint8_t **w, uint32_t id) { uint8_t *w_id = wah_init(id); if (*w == NULL) { *w = w_id; } else { uint8_t *r = NULL; uint32_t r_size = 0; uint32_t resize = wah_or(*w, w_id, &r, &r_size); free(*w); free(w_id); *w = r; } }
//{{{void wah_leading_union_with_B(void **R, void *leading) void wah_leading_union_with_B(uint32_t domain, void **R, void *leading) { struct wah_bpt_leading_data *ld = (struct wah_bpt_leading_data *)leading; if ((ld != NULL) && (ld->B != NULL)) { uint8_t **w = (uint8_t **)R; if (*w == NULL) *w = wah_init(0); uint8_t *r = NULL; uint32_t r_size = 0; uint32_t resize = wah_or(*w, ld->B, &r, &r_size); free(*w); *w = r; } }
/*===========================================================================*/ int main(void) { /* * 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(); /* * kruciální řádek protože pokud se to zapne bez debugru tak je tam * jenom bordel a když se to pak srovnává s NULL tak se to cely * vymrdá a skoči do unhandled exception */ uint8_t i; for (i = 0 ; i< 60 ; i++) logic_pointery[i] = NULL; //test_logic_fill(); chThdSleepMilliseconds(100); /* * Activates the USB driver and then the USB bus pull-up on D+. */ usb_user_init(); /* * Shell manager initialization. */ shellInit(); /* * Init tft display ssd1289 and gui */ gui_init(); /** * @brief start the whole bad thing */ logic_init(); /* * start external interrupt system */ extStart(&EXTD1, &extcfg); /* * start wah thread */ wah_init(); /* * Normal main() thread activity, in this demo it does nothing except * sleeping in a loop and check the button state. */ EventListener el; chEvtRegister(&event_touch, &el, TOUCH_PUSH); #ifdef I2C_TEST i2c_test(); #endif gui_thread(); while(TRUE); }