-
Notifications
You must be signed in to change notification settings - Fork 158
Simplify application #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
evedon
merged 17 commits into
ARMmbed:master
from
hugueskamba:hk-multi-threaded-blinky-and-baremetal
Nov 4, 2019
Merged
Simplify application #192
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
62c995e
Use threads comms to blink and add baremetal version
hugueskamba 7b12e79
Add application variants and Mbed OS bare metal tutorial
hugueskamba 007b92b
Remove multithreaded application
hugueskamba b3e0e50
Remove `tests` as no longer relevant
hugueskamba 9f4477f
Correct the last force push resulting from rebasing from the master b…
hugueskamba 3e5b7df
Marked the example as official
hugueskamba 2f96047
Addressing PR review comments and adding a smaller badge
hugueskamba 2022670
Remove bare metal information in the project
hugueskamba 8b7730c
Merge branch 'master' into hk-multi-threaded-blinky-and-baremetal
hugueskamba 0010085
Move supported toolchain info to the "Building and Running" section
hugueskamba 96c4eba
Add an "Expected output" section to README.
hugueskamba 77b6b31
Add information about importing to the online compiler.
hugueskamba effcefb
Say that the example is part of the official Mbed OS examples
hugueskamba 1b45642
Add commands to download the project with `git clone` and `mbed import`.
hugueskamba 5213199
Apply suggestions from code review
hugueskamba de2bd2c
Correct indentation
hugueskamba 4eb2565
Add nitpicky punctuation
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,23 @@ | ||
| /* mbed Microcontroller Library | ||
| * Copyright (c) 2018 ARM Limited | ||
| * Copyright (c) 2019 ARM Limited | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include "mbed.h" | ||
| #include "platform/mbed_thread.h" | ||
| #include "stats_report.h" | ||
|
|
||
| DigitalOut led1(LED1); | ||
|
|
||
| #define SLEEP_TIME 500 // (msec) | ||
| #define PRINT_AFTER_N_LOOPS 20 | ||
| // Blinking rate in milliseconds | ||
| #define BLINKING_RATE_MS 500 | ||
|
|
||
|
|
||
| // main() runs in its own thread in the OS | ||
| int main() | ||
| { | ||
| SystemReport sys_state( SLEEP_TIME * PRINT_AFTER_N_LOOPS /* Loop delay time in ms */); | ||
| // Initialise the digital pin LED1 as an output | ||
| DigitalOut led(LED1); | ||
|
|
||
| int count = 0; | ||
| while (true) { | ||
| // Blink LED and wait 0.5 seconds | ||
| led1 = !led1; | ||
| thread_sleep_for(SLEEP_TIME); | ||
|
|
||
| if ((0 == count) || (PRINT_AFTER_N_LOOPS == count)) { | ||
| // Following the main thread wait, report on the current system status | ||
| sys_state.report_state(); | ||
| count = 0; | ||
| } | ||
| ++count; | ||
| led = !led; | ||
| thread_sleep_for(BLINKING_RATE_MS); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| https://github.com/ARMmbed/mbed-os/#679d24833acf0a0b5b0d528576bb37c70863bc4e | ||
| https://github.com/ARMmbed/mbed-os/#679d24833acf0a0b5b0d528576bb37c70863bc4e |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.