-
Notifications
You must be signed in to change notification settings - Fork 0
/
EscharotomyArm.h
55 lines (45 loc) · 1.11 KB
/
EscharotomyArm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef _ESCHAROTOMY_ARM_H_
#define _ESCHAROTOMY_ARM_H_
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "Config/AppConfig.h"
#include "Timer.h"
#define ESCHAR_CUT_THRESH 200
#define MAKE_ESCHAR_MSG(x) DEFINE_PSTRING( eschar_msg_##x , "ARM_L_ESCHAR_" #x )
//MAKE_ESCHAR_MSG(1);
/*
MAKE_ESCHAR_MSG(2);
MAKE_ESCHAR_MSG(3);
MAKE_ESCHAR_MSG(4);
MAKE_ESCHAR_MSG(5);
*/
/* these are adc pin numbrs, in adc_values */
#define ESCHAR_PIN_1 6
#define ESCHAR_PIN_2 5
#define ESCHAR_PIN_3 4
#define ESCHAR_PIN_4 1
#define ESCHAR_PIN_5 0
/* when 4 is cut resume the pulse */
/* these pins form an L shape with the long arm under the skin
eskinskinskinskinskin
l 3 2 1
b 4
o 5
wbonebonebonebonebone
*/
uint8_t eschar_msg_state_1;
uint8_t eschar_msg_state_2;
uint8_t eschar_msg_state_3;
uint8_t eschar_msg_state_4;
uint8_t eschar_msg_state_5;
#define ESCHAR_MSG_WAITING 1
#define ESCHAR_MSG_SENT 2
// 0 means not yet detected
void eschar_init(void);
void eschar_task(uint16_t* adc_values);
void pulse_task(void);
void pulse_set_delay(int delay);
void pulse_stop(void);
void pulse_init(void);
void heat_enable(void);
#endif