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.
Dependencies: mbed
LUTs_debug.h
00001 #ifndef LUTS_DEBUG_H 00002 #define LUTS_DEBUG_H 00003 00004 /** Spaceship Test 00005 @brief Checks LUT values are correct 00006 @author Luke Cartwright, University of Leeds 00007 @date May 2020 00008 @return true if debug is passed 00009 */ 00010 00011 // Objects 00012 LUTs luts; 00013 00014 /**debugs sine wave 00015 * @takes input wavetable number and expected 00016 * @returns true sin table value 00017 */ 00018 bool sin_debug(int i, int expected_sin) { 00019 luts.sin_wavetable(); 00020 if (sin_wavtable[i]==expected_sin) { 00021 return (1); 00022 } else { 00023 printf("expected-%i__real-%u \n",expected_sin,sin_wavtable[i]); 00024 return(0); 00025 } 00026 } 00027 00028 /**debugs tri wave 00029 * @takes input Pulsewidth, wavetable number and expected 00030 * @returns true tri table value 00031 */ 00032 bool tri_debug(int pulsewidth,int i, int expected_tri) 00033 { 00034 luts.tri_wavetable(pulsewidth); 00035 00036 if (tri_wavtable[i]==expected_tri) { 00037 return (1); 00038 } else { 00039 printf("expected-%i__real-%u \n",expected_tri,tri_wavtable[i]); 00040 return(0); 00041 } 00042 } 00043 00044 /**debugs sqr wave 00045 * @takes input Pulsewidth, wavetable number and expected 00046 * @returns true sqr table value 00047 */ 00048 bool pulse_debug(int pulsewidth,int i, int expected_pulse) 00049 { 00050 luts.pulse_wavetable(pulsewidth); 00051 00052 if (pulse_wavtable[i]==expected_pulse) { 00053 return (1); 00054 } else { 00055 printf("expected-%i__real-%u \n",expected_pulse,pulse_wavtable[i]); 00056 return(0); 00057 } 00058 } 00059 00060 #endif
Generated on Wed Jul 13 2022 21:50:34 by
