Modify the file main.cpp for M487

Committer:
shliu1
Date:
Fri Sep 29 05:44:18 2017 +0000
Revision:
0:0dfa64725959
main.cpp adds the setting of TARGET_NUMAKER_PFM_M487 for M487

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shliu1 0:0dfa64725959 1 #include "mbed.h"
shliu1 0:0dfa64725959 2 #include "rtos.h"
shliu1 0:0dfa64725959 3 #if defined(TARGET_NUMAKER_PFM_NUC472)
shliu1 0:0dfa64725959 4 DigitalOut led1(LED1);
shliu1 0:0dfa64725959 5 DigitalOut led2(LED2);
shliu1 0:0dfa64725959 6 #elif defined(TARGET_NUMAKER_PFM_M453)
shliu1 0:0dfa64725959 7 DigitalOut led1(LED1);
shliu1 0:0dfa64725959 8 DigitalOut led2(LED2);
shliu1 0:0dfa64725959 9 #elif defined(TARGET_NUMAKER_PFM_M487)
shliu1 0:0dfa64725959 10 DigitalOut led1(LED1);
shliu1 0:0dfa64725959 11 DigitalOut led2(LED2);
shliu1 0:0dfa64725959 12 #endif
shliu1 0:0dfa64725959 13
shliu1 0:0dfa64725959 14 void led2_thread(void const *args) {
shliu1 0:0dfa64725959 15 while (true) {
shliu1 0:0dfa64725959 16 led2 = !led2;
shliu1 0:0dfa64725959 17 Thread::wait(1000);
shliu1 0:0dfa64725959 18 }
shliu1 0:0dfa64725959 19 }
shliu1 0:0dfa64725959 20
shliu1 0:0dfa64725959 21 int main() {
shliu1 0:0dfa64725959 22 Thread thread(led2_thread);
shliu1 0:0dfa64725959 23
shliu1 0:0dfa64725959 24 while (true) {
shliu1 0:0dfa64725959 25 led1 = !led1;
shliu1 0:0dfa64725959 26 Thread::wait(500);
shliu1 0:0dfa64725959 27 }
shliu1 0:0dfa64725959 28 }