int main(void) { WDT_DISABLE; BC1MSET; USCIAB0RX_ISR_callbacks = rx_callbacks; uart_init(UART0, 1000000, 9600); uart_XLED_enable(UART0); uart_interrupt_enable(UART0); P1DIR &= ~BUTTON; P1REN |= BUTTON; P1OUT |= BUTTON; qputs(UART0, "Inited.\n"); json_handle a; while (1){ p = text; wait = 1; _BIS_SR(CPUOFF + GIE); wait = 0; *p = '\0'; if (P1IN & BUTTON) {// Key not pressed a = objTest(); } else { pos = 0; a = json_createObjectObj("root", json_createStringObj("response","cleared"), NULL); } json_dump(text, a); json_free_rude(a); // int i; // qputh(_uart1, 0xff & (pos >> 8)); // qputh(_uart1, 0xff & (pos)); // qputc(_uart1,'\n'); // for (i=0;i<PERIOD_LENGTH/2;i++){ // // //qputs(_uart1, " 0x"); // qputh(_uart1, 0xff & (data[pos+i] >> 8)); // qputh(_uart1, 0xff & data[pos+i]); // } // qputs(_uart1, "\n============\n"); // base64enc(text, &data[pos], PERIOD_LENGTH); qputs(UART0, text); qputc(UART0, '\n'); //__delay_cycles(800000); } }
MojErr MojVectorTest::run() { MojErr err = intTest(); MojTestErrCheck(err); err = stringTest(); MojTestErrCheck(err); err = objTest(); MojTestErrCheck(err); return MojErrNone; }