Bare-metal configuration for a Bluepill board.
Warning
It does not work with the Mbed Online Compiler.
Follow these steps to import and compile them with Mbed CLI:
mbed import https://os.mbed.com/users/hudakz/code/Baremetal_Blinky_Bluepill mbed compile -t GCC_ARM -m bluepill
main.cpp@1:57decb93282e, 2020-05-14 (annotated)
- Committer:
- hudakz
- Date:
- Thu May 14 17:49:00 2020 +0000
- Revision:
- 1:57decb93282e
- Parent:
- 0:a04710facbb6
Bare-metal configuration for a Bluepill board.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hudakz | 0:a04710facbb6 | 1 | /* mbed Microcontroller Library |
hudakz | 0:a04710facbb6 | 2 | * Copyright (c) 2019 ARM Limited |
hudakz | 0:a04710facbb6 | 3 | * SPDX-License-Identifier: Apache-2.0 |
hudakz | 0:a04710facbb6 | 4 | */ |
hudakz | 0:a04710facbb6 | 5 | #include "mbed.h" |
hudakz | 0:a04710facbb6 | 6 | |
hudakz | 0:a04710facbb6 | 7 | // Blinking rate in milliseconds |
hudakz | 0:a04710facbb6 | 8 | #define BLINKING_RATE_MS 500 |
hudakz | 0:a04710facbb6 | 9 | |
hudakz | 0:a04710facbb6 | 10 | |
hudakz | 0:a04710facbb6 | 11 | int main() |
hudakz | 0:a04710facbb6 | 12 | { |
hudakz | 0:a04710facbb6 | 13 | // Initialise the digital pin LED1 as an output |
hudakz | 0:a04710facbb6 | 14 | DigitalOut led(LED1); |
hudakz | 0:a04710facbb6 | 15 | |
hudakz | 0:a04710facbb6 | 16 | while (true) { |
hudakz | 0:a04710facbb6 | 17 | led = !led; |
hudakz | 1:57decb93282e | 18 | wait_ms(BLINKING_RATE_MS); |
hudakz | 0:a04710facbb6 | 19 | } |
hudakz | 0:a04710facbb6 | 20 | } |