Skip to content

Commit

Permalink
Makes microdelay use C linkage. (#618)
Browse files Browse the repository at this point in the history
* Makes microdelay use C linkage.
Fixes up the clang-format rules to not indent after extern "C".
  • Loading branch information
balazsracz authored Apr 16, 2022
1 parent a009d80 commit 28df8db
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,25 @@ SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4

# This big block of settings works around indentation after an extern "C"
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBraces: Custom
IndentExternBlock: false
...

2 changes: 1 addition & 1 deletion src/os/sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ static void microsleep(uint32_t microseconds) __attribute__((weakref("usleep")))
/// Executes a busy loop for a given amount of time. It is recommended to use
/// this only for small number of microseconds (e.g. <100 usec).
/// @param microseconds how long to delay.
extern void microdelay(uint32_t microseconds);
extern "C" void microdelay(uint32_t microseconds);

#endif // _OS_SLEEP_H_

0 comments on commit 28df8db

Please sign in to comment.