Gilles Raynaud
/
test1
essai
main.cpp@5:bb583c3b1c58, 2020-11-15 (annotated)
- Committer:
- gr91
- Date:
- Sun Nov 15 21:05:04 2020 +0100
- Revision:
- 5:bb583c3b1c58
- Parent:
- 4:5974db399f25
ff
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gr91 | 0:b3f6eeee5292 | 1 | /* mbed Microcontroller Library |
gr91 | 0:b3f6eeee5292 | 2 | * Copyright (c) 2019 ARM Limited |
gr91 | 0:b3f6eeee5292 | 3 | * SPDX-License-Identifier: Apache-2.0 |
gr91 | 0:b3f6eeee5292 | 4 | */ |
gr91 | 0:b3f6eeee5292 | 5 | |
gr91 | 0:b3f6eeee5292 | 6 | #include "mbed.h" |
gr91 | 0:b3f6eeee5292 | 7 | #include <cstdio> |
gr91 | 0:b3f6eeee5292 | 8 | |
gr91 | 0:b3f6eeee5292 | 9 | #define WAIT_TIME_MS 500 |
gr91 | 0:b3f6eeee5292 | 10 | DigitalOut led1(LED1); |
gr91 | 0:b3f6eeee5292 | 11 | int a=0; |
gr91 | 0:b3f6eeee5292 | 12 | int main() |
gr91 | 0:b3f6eeee5292 | 13 | { |
gr91 | 0:b3f6eeee5292 | 14 | volatile static int b; |
gr91 | 0:b3f6eeee5292 | 15 | volatile int c; |
gr91 | 0:b3f6eeee5292 | 16 | printf("This is the bare metal blinky example running on Mbed OS %d.%d.%d.\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION); |
gr91 | 0:b3f6eeee5292 | 17 | while (true) |
gr91 | 0:b3f6eeee5292 | 18 | { |
gr91 | 5:bb583c3b1c58 | 19 | a=a+1234; //// |
gr91 | 0:b3f6eeee5292 | 20 | c=a; |
gr91 | 0:b3f6eeee5292 | 21 | b=c; |
gr91 | 0:b3f6eeee5292 | 22 | led1 = !led1; |
gr91 | 0:b3f6eeee5292 | 23 | printf( " a=%d ; b=%d ; c=%d \r\n",a,b,c); |
gr91 | 0:b3f6eeee5292 | 24 | //thread_sleep_for(WAIT_TIME_MS); |
gr91 | 0:b3f6eeee5292 | 25 | wait_us(1000000); |
gr91 | 0:b3f6eeee5292 | 26 | } |
gr91 | 0:b3f6eeee5292 | 27 | } |