void main_thread(void * arg) { Ar::Thread * self = Ar::Thread::getCurrent(); const char * myName = self->getName(); printf("[%s] Main thread is running\r\n", myName); g_testCase.init(); g_testCase.run(); g_accLock.init("accLock"); g_x.init("x"); g_y.init("y"); g_z.init("z"); g_xThread.init("x", x_thread, 0, 55); g_xThread.resume(); g_yThread.init("y", y_thread, 0, 55); g_yThread.resume(); g_zThread.init("z", z_thread, 0, 55); g_zThread.resume(); g_blueThread.init("blue", blue_thread, 0, 50); g_blueThread.resume(); g_greenThread.init("green", green_thread, 0, 50); g_greenThread.resume(); g_redThread.init("red", red_thread, 0, 50); g_redThread.resume(); printf("[%s] goodbye!\r\n", myName); }
void main(void) { // debug_init(); printf("Running test...\r\n"); // (const char * name, thread_entry_t entry, void * param, void * stack, unsigned stackSize, uint8_t priority); g_mainThread.init("main", main_thread, 0, 56); g_mainThread.resume(); Ar::Kernel::run(); Ar::_halt(); }