|
|
@@ -17,8 +17,6 @@ uint16_t send_adc; |
|
|
|
uint16_t send_dac;
|
|
|
|
int possible_overflow = 0;
|
|
|
|
|
|
|
|
float dac_current;
|
|
|
|
|
|
|
|
#define TIMER_RATE 8000 /* how often to read the ADC and update DAC */
|
|
|
|
#define PC_RATE 8000 /* how often to send data to the PC */
|
|
|
|
|
|
|
@@ -96,10 +94,10 @@ void run_normal(void) |
|
|
|
led_on();
|
|
|
|
|
|
|
|
/* Assume startup current is 0 */
|
|
|
|
dac_current = 0.0;
|
|
|
|
dac_write(current_to_dac(dac_current));
|
|
|
|
msleep(100);
|
|
|
|
degauss();
|
|
|
|
// dac_current = 0.0;
|
|
|
|
// dac_write(current_to_dac(dac_current));
|
|
|
|
// msleep(100);
|
|
|
|
// degauss();
|
|
|
|
|
|
|
|
timer_setup_16bit(5, TIMER_RATE, 1);
|
|
|
|
timer_set_priority(5, 6);
|
|
|
|