void logPanic(const char *panicTxt) /* intended to be called from the SYSTEM_HALT_HOOK */ { if (!panicTxt) panicTxt = "<stack crash>"; debugPuts("\nPANIC!"); debugPuts(panicTxt); chSysLock(); chSchGoSleepS(THD_STATE_FINAL); }
void dump(unsigned char *data, unsigned int size) { debugPuts("DUMP %d bytes ...\n\r", size); unsigned int i = 0, j=0; while (i*32+j < size) { debugPuts("%.2X ", data[i*32+j]); j++; if (j==32) { i++; j=0; debugPuts("\n\r"); } } debugPuts("\n\r"); }
/*! \brief Main loop. * * Most of the action is interrupt driven. * * @return Never exits */ void main(void) { EnableInterrupts; /* enable interrupts */ //TERMIO_Init(); //initdebugMessageBuffer(); //dprint("main():Starting\r\n"); autoInitClock(); // initCrystalClock(clockFactors[clksel_12MHz]); #if (DEBUG&SCI_DEBUG) != 0) debugSCIInit(); debugPuts("main(): Starting\r"); #endif init(); commandLoop(); // doesn't return // for(;;) { // dprint("main():Waiting\r\n"); // wait(); // } }