Pulse Oximeter (NONIN) communicates with mbed via Bluetooth dongle and sends Heart Rate and Oxygen Saturation via GPRS module
Dependencies: C12832 GPS GSM mbed
Fork of myBlueUSB_localfix by
AvailableMemory/AvailableMemory.h@3:55a622e3dbb5, 2015-04-14 (annotated)
- Committer:
- samialshorman
- Date:
- Tue Apr 14 21:48:07 2015 +0000
- Revision:
- 3:55a622e3dbb5
- Parent:
- 0:003889bc474f
Nonin (Pulse Oximeter) connected to mbed lpc 1768 by Bluetooth dongle and sends SMS including Heart Rate and Oxygen saturation by GPRS module
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nobukuma | 0:003889bc474f | 1 | /** @file |
nobukuma | 0:003889bc474f | 2 | * Return the memory available for a malloc call. |
nobukuma | 0:003889bc474f | 3 | */ |
nobukuma | 0:003889bc474f | 4 | #ifndef SEGUNDO_UTILITIES_AVAILABLEMEMORY_H |
nobukuma | 0:003889bc474f | 5 | #define SEGUNDO_UTILITIES_AVAILABLEMEMORY_H |
nobukuma | 0:003889bc474f | 6 | |
nobukuma | 0:003889bc474f | 7 | /** |
nobukuma | 0:003889bc474f | 8 | * Segundo Equipo |
nobukuma | 0:003889bc474f | 9 | */ |
nobukuma | 0:003889bc474f | 10 | namespace segundo { |
nobukuma | 0:003889bc474f | 11 | /** |
nobukuma | 0:003889bc474f | 12 | * A collection of utilities |
nobukuma | 0:003889bc474f | 13 | */ |
nobukuma | 0:003889bc474f | 14 | namespace Utilities { |
nobukuma | 0:003889bc474f | 15 | |
nobukuma | 0:003889bc474f | 16 | /** Return the memory available for a malloc call. |
nobukuma | 0:003889bc474f | 17 | * This is done by a binary search approach |
nobukuma | 0:003889bc474f | 18 | * calling malloc/free starting with a maximum. |
nobukuma | 0:003889bc474f | 19 | * |
nobukuma | 0:003889bc474f | 20 | * Example: |
nobukuma | 0:003889bc474f | 21 | * @code |
nobukuma | 0:003889bc474f | 22 | * #include <stdio.h> |
nobukuma | 0:003889bc474f | 23 | * #include "AvailableMemory.h" |
nobukuma | 0:003889bc474f | 24 | * |
nobukuma | 0:003889bc474f | 25 | * int main() { |
nobukuma | 0:003889bc474f | 26 | * |
nobukuma | 0:003889bc474f | 27 | * printf("Available memory (bytes to nearest 256) : %d\n", AvailableMemory()); |
nobukuma | 0:003889bc474f | 28 | * printf("Available memory (exact bytes) : %d\n", AvailableMemory(1)); |
nobukuma | 0:003889bc474f | 29 | * |
nobukuma | 0:003889bc474f | 30 | * } |
nobukuma | 0:003889bc474f | 31 | * @endcode |
nobukuma | 0:003889bc474f | 32 | * @param resolution Resolution in number of bytes, |
nobukuma | 0:003889bc474f | 33 | * 1 will return the exact value, |
nobukuma | 0:003889bc474f | 34 | * default will return the available memory to the nearest 256 bytes |
nobukuma | 0:003889bc474f | 35 | * @param maximum Maximum amount of memory to check, default is 32K (0x8000) |
nobukuma | 0:003889bc474f | 36 | * @param disableInterrupts Disable interrupts whilst checking, default is true |
nobukuma | 0:003889bc474f | 37 | * @return Available memory in bytes accurate to within resolution |
nobukuma | 0:003889bc474f | 38 | */ |
nobukuma | 0:003889bc474f | 39 | int AvailableMemory(int resolution = 256, int maximum = 0x8000, bool disableInterrupts = true); |
nobukuma | 0:003889bc474f | 40 | |
nobukuma | 0:003889bc474f | 41 | } // namespace Utilities |
nobukuma | 0:003889bc474f | 42 | } // namespace segundo |
nobukuma | 0:003889bc474f | 43 | |
nobukuma | 0:003889bc474f | 44 | using namespace segundo::Utilities; |
nobukuma | 0:003889bc474f | 45 | |
nobukuma | 0:003889bc474f | 46 | #endif // SEGUNDO_UTILITIES_AVAILABLEMEMORY_H |