Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Task690-mbed-os-FZ429ZI by
buffer.hpp@5:cc1b9f5c27a0, 2017-12-10 (annotated)
- Committer:
- osmith2
- Date:
- Sun Dec 10 20:17:31 2017 +0000
- Revision:
- 5:cc1b9f5c27a0
- Child:
- 6:c2299e3de428
First attempt at task 1. Reading LDR, temp, and pressure data into a 120 sample FIFO buffer, using threads.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
osmith2 | 5:cc1b9f5c27a0 | 1 | #ifndef __BUFFER__ |
osmith2 | 5:cc1b9f5c27a0 | 2 | #define __BUFFER__ |
osmith2 | 5:cc1b9f5c27a0 | 3 | |
osmith2 | 5:cc1b9f5c27a0 | 4 | #include "mbed.h" |
osmith2 | 5:cc1b9f5c27a0 | 5 | |
osmith2 | 5:cc1b9f5c27a0 | 6 | //Size of the morse character buffer |
osmith2 | 5:cc1b9f5c27a0 | 7 | #define BUFFERSIZE 10 // CW specified 120 samples |
osmith2 | 5:cc1b9f5c27a0 | 8 | |
osmith2 | 5:cc1b9f5c27a0 | 9 | extern Semaphore spaceAvailable; |
osmith2 | 5:cc1b9f5c27a0 | 10 | extern Semaphore samplesInBuffer; |
osmith2 | 5:cc1b9f5c27a0 | 11 | extern Mutex bufferLock; |
osmith2 | 5:cc1b9f5c27a0 | 12 | |
osmith2 | 5:cc1b9f5c27a0 | 13 | |
osmith2 | 5:cc1b9f5c27a0 | 14 | extern void addToBuffer(float c); |
osmith2 | 5:cc1b9f5c27a0 | 15 | extern float takeFromBuffer(); |
osmith2 | 5:cc1b9f5c27a0 | 16 | |
osmith2 | 5:cc1b9f5c27a0 | 17 | |
osmith2 | 5:cc1b9f5c27a0 | 18 | |
osmith2 | 5:cc1b9f5c27a0 | 19 | |
osmith2 | 5:cc1b9f5c27a0 | 20 | #endif |