Revision e2a3c71f
ID | e2a3c71f71fc38f72a7175df2e257c5b024bee41 |
Parent | 2dde134c |
Added shutoff when current is sensed when enabling tool
Also made a number of fixes to current sensing, which was quite broken.
toolbox/time.c | ||
---|---|---|
2 | 2 |
#include <avr/io.h> |
3 | 3 |
#include <avr/interrupt.h> |
4 | 4 |
#include "time.h" |
5 |
#include "current.h" |
|
5 | 6 |
|
6 | 7 |
/* F_CPU / PRESCALE = OCR * 1000 + ERROR */ |
7 | 8 |
#define OCR (F_CPU / PRESCALE / 1000UL) |
... | ... | |
23 | 24 |
ready = 1; |
24 | 25 |
ms = 0; |
25 | 26 |
} |
27 |
if (ms % 2 == 0) { |
|
28 |
current_start_adc(); // TODO don't do this here |
|
29 |
} |
|
26 | 30 |
} |
27 | 31 |
|
28 | 32 |
void time_init() { |
Also available in: Unified diff