Browse Source

update to fix build issues. Time to test?

git-svn-id: https://bucket.mit.edu/svn/nilm/zoom@7693 ddd99763-3ecb-0310-9145-efcb8ce7c51f
tags/zoom-1.0
jim 14 years ago
parent
commit
219b30e0d7
3 changed files with 9 additions and 6 deletions
  1. +1
    -0
      firmware/calibrate.c
  2. +4
    -6
      firmware/mode_normal.c
  3. +4
    -0
      firmware/util.h

+ 1
- 0
firmware/calibrate.c View File

@@ -4,6 +4,7 @@
#include "adc.h"
#include "dac.h"
#include "led.h"
#include "timer.h"
float g_scale; /* delta(DAC) / delta(ADC) */


+ 4
- 6
firmware/mode_normal.c View File

@@ -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);


+ 4
- 0
firmware/util.h View File

@@ -34,4 +34,8 @@ int32_t hex_to_u16(char x[4]);

#define clamp(a,v,b) min(b,max(v,a))

#define abs(a) \
({ typeof (a) _a = (a); \
_a < 0 ? _a : -_a; })

#endif

Loading…
Cancel
Save