Luke Cartwright / Mbed 2 deprecated ELEC2645_Project_el18loc_nearlythere

Dependencies:   mbed

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?

UserRevisionLine numberNew 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