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.
LUTs/LUTs_debug.h@9:f6ba53e355a0, 2020-05-06 (annotated)
- Committer:
- lukeocarwright
- Date:
- Wed May 06 14:37:34 2020 +0000
- Revision:
- 9:f6ba53e355a0
- Child:
- 10:258a1eca02cc
Outputted sin LUT in uint16_t with unit test using DEBUG macro. Allows direct writing of value to table to 16-bit DAC.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lukeocarwright | 9:f6ba53e355a0 | 1 | #ifndef LUTS_DEBUG_H |
lukeocarwright | 9:f6ba53e355a0 | 2 | #define LUTS_DEBUG_H |
lukeocarwright | 9:f6ba53e355a0 | 3 | |
lukeocarwright | 9:f6ba53e355a0 | 4 | /** Spaceship Test |
lukeocarwright | 9:f6ba53e355a0 | 5 | @brief Checks LUT values are correct |
lukeocarwright | 9:f6ba53e355a0 | 6 | @author Luke Cartwright, University of Leeds |
lukeocarwright | 9:f6ba53e355a0 | 7 | @date May 2020 |
lukeocarwright | 9:f6ba53e355a0 | 8 | @return true if debug is passed |
lukeocarwright | 9:f6ba53e355a0 | 9 | */ |
lukeocarwright | 9:f6ba53e355a0 | 10 | |
lukeocarwright | 9:f6ba53e355a0 | 11 | bool sin_debug(int i, int expected_sin) |
lukeocarwright | 9:f6ba53e355a0 | 12 | { |
lukeocarwright | 9:f6ba53e355a0 | 13 | // Objects |
lukeocarwright | 9:f6ba53e355a0 | 14 | LUTs luts; |
lukeocarwright | 9:f6ba53e355a0 | 15 | |
lukeocarwright | 9:f6ba53e355a0 | 16 | //method |
lukeocarwright | 9:f6ba53e355a0 | 17 | luts.sin_wavetable(); |
lukeocarwright | 9:f6ba53e355a0 | 18 | |
lukeocarwright | 9:f6ba53e355a0 | 19 | if (sin_wavtable[i]==expected_sin) { |
lukeocarwright | 9:f6ba53e355a0 | 20 | return (1); |
lukeocarwright | 9:f6ba53e355a0 | 21 | } else { |
lukeocarwright | 9:f6ba53e355a0 | 22 | return(0); |
lukeocarwright | 9:f6ba53e355a0 | 23 | } |
lukeocarwright | 9:f6ba53e355a0 | 24 | } |
lukeocarwright | 9:f6ba53e355a0 | 25 | #endif |