arranged by katano
Dependencies: MPU9150_DMP Neon_F303K8 QuaternionMath iSDIO mbed-rtos mbed
Fork of Neon_F303K8 by
main.cpp@1:73543a1fbe62, 2016-05-16 (annotated)
- Committer:
- yishii
- Date:
- Mon May 16 15:21:20 2016 +0000
- Revision:
- 1:73543a1fbe62
- Parent:
- 0:65a0ae5578da
- Child:
- 3:5f0d6133d34c
????????????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yishii | 0:65a0ae5578da | 1 | #include "mbed.h" |
yishii | 0:65a0ae5578da | 2 | #include "rtos.h" |
yishii | 0:65a0ae5578da | 3 | #include "math.h" |
yishii | 0:65a0ae5578da | 4 | #include "iSDIO.h" |
yishii | 0:65a0ae5578da | 5 | #include "gpio_defs.h" |
yishii | 0:65a0ae5578da | 6 | |
yishii | 1:73543a1fbe62 | 7 | #ifndef TARGET_NUCLEO_F303K8 |
yishii | 1:73543a1fbe62 | 8 | #error This program only supports to run on Nucleo F303K8. |
yishii | 1:73543a1fbe62 | 9 | #endif |
yishii | 1:73543a1fbe62 | 10 | |
yishii | 0:65a0ae5578da | 11 | extern void TaskSensor(void const* ); |
yishii | 0:65a0ae5578da | 12 | extern void TaskLed(void const* ); |
yishii | 0:65a0ae5578da | 13 | extern void TaskFA(void const* ); |
yishii | 0:65a0ae5578da | 14 | |
yishii | 0:65a0ae5578da | 15 | Thread* threadLed = NULL; |
yishii | 0:65a0ae5578da | 16 | Thread* threadSensor = NULL; |
yishii | 0:65a0ae5578da | 17 | Thread* threadFA = NULL; |
yishii | 0:65a0ae5578da | 18 | |
yishii | 0:65a0ae5578da | 19 | Serial pc(USBTX, USBRX); |
yishii | 0:65a0ae5578da | 20 | |
yishii | 0:65a0ae5578da | 21 | int main() { |
yishii | 0:65a0ae5578da | 22 | pc.baud(115200); |
yishii | 0:65a0ae5578da | 23 | printf("Startup Neon main program\r\n"); |
yishii | 0:65a0ae5578da | 24 | |
yishii | 0:65a0ae5578da | 25 | Thread::wait(500); // 適当な待ち時間 |
yishii | 0:65a0ae5578da | 26 | |
yishii | 0:65a0ae5578da | 27 | //threadLed = new Thread(TaskLed, NULL, osPriorityNormal, DEFAULT_STACK_SIZE, NULL ); |
yishii | 1:73543a1fbe62 | 28 | threadSensor = new Thread(TaskSensor, NULL, osPriorityNormal, DEFAULT_STACK_SIZE*2, NULL ); // スタックサイズ未検証 |
yishii | 1:73543a1fbe62 | 29 | //threadFA = new Thread(TaskFA, NULL, osPriorityNormal, DEFAULT_STACK_SIZE , NULL ); |
yishii | 0:65a0ae5578da | 30 | |
yishii | 0:65a0ae5578da | 31 | while(true){ |
yishii | 1:73543a1fbe62 | 32 | StatusLED = 1; |
yishii | 1:73543a1fbe62 | 33 | Thread::wait(800); |
yishii | 1:73543a1fbe62 | 34 | StatusLED = 0; |
yishii | 1:73543a1fbe62 | 35 | Thread::wait(800); |
yishii | 0:65a0ae5578da | 36 | } |
yishii | 0:65a0ae5578da | 37 | } |
yishii | 1:73543a1fbe62 | 38 |