arranged by katano
Dependencies: MPU9150_DMP Neon_F303K8 QuaternionMath iSDIO mbed-rtos mbed
Fork of Neon_F303K8 by
main.cpp
- Committer:
- yakatano
- Date:
- 2016-08-05
- Revision:
- 4:636bb3f66dcd
- Parent:
- 3:5f0d6133d34c
File content as of revision 4:636bb3f66dcd:
#include "mbed.h" #include "rtos.h" #include "math.h" #include "iSDIO.h" #include "gpio_defs.h" #ifndef TARGET_NUCLEO_F303K8 #error This program only supports to run on Nucleo F303K8. #endif extern void TaskSensor(void const* ); extern void TaskLed(void const* ); //extern void TaskFA(void const* ); //Thread* threadLed = NULL; Thread* threadSensor = NULL; //Thread* threadFA = NULL; Serial pc(USBTX, USBRX); int main() { pc.baud(115200); printf("Startup Neon main program\r\n"); Thread::wait(500); // 適当な待ち時間 //threadLed = new Thread(TaskLed, NULL, osPriorityNormal, DEFAULT_STACK_SIZE, NULL ); threadSensor = new Thread(TaskSensor, NULL, osPriorityNormal, DEFAULT_STACK_SIZE*2, NULL ); // スタックサイズ未検証 //threadFA = new Thread(TaskFA, NULL, osPriorityNormal, DEFAULT_STACK_SIZE , NULL ); //pc.attach(pc_rx, Serial::RxIrq); char recv[1024]; while(true){ if(pc.readable()) { char ch = pc.getc(); //pc.putc('$'); //pc.printf("%s\r\n", ch); switch(ch){ case 'z': sprintf(recv, ""); break; case 'a': if(StatusLED == 1){StatusLED = 0;} else{StatusLED = 1;} break; case '1': if(StatusLED == 1){StatusLED = 0;} else{StatusLED = 1;} break; default: printf("%c\r\n", ch); //sprintf(recv, "%s%c", recv,ch); //pc.printf(recv); break; } } /* StatusLED = 1; Thread::wait(800); StatusLED = 0; Thread::wait(800); */ } }