-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bsp: Synchronize serial driver access (#29)
The serial driver is used by multiple tasks and not all tasks use the Log APIs to send data to the serial driver. This was causing serial data buffer corruption. Synchronise the access of the serial driver using mutual exclusion to make it thread-safe. This also removes code duplication and fixes return values for the write system call: * Arm GNU Toolchain: On failure, `-1`. On success, total chars written. * Arm Compiler: On failure, a positive number representing the number of chars NOT written or a negative number indicating an error. On success, `0`. Signed-off-by: Devaraj Ranganna <[email protected]> Signed-off-by: Hugues Kamba-Mpiana <[email protected]> Co-authored-by: Devaraj Ranganna <[email protected]>
- Loading branch information
1 parent
75f27d4
commit 4862547
Showing
3 changed files
with
92 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
serial: Fix multithread synchronisation |