forked from triffid/FiveD_on_Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimulation.h
84 lines (66 loc) · 1.32 KB
/
simulation.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#if !defined _SIMULATION_H && defined SIMULATION
#define _SIMULATION_H
#include <stdint.h>
#include <stdbool.h>
#define PROGMEM
#define PGM_P const char *
#define PSTR(x) (x)
#define pgm_read_byte(x) (*((uint8_t *)(x)))
#define pgm_read_word(x) (*((uint16_t *)(x)))
#define MASK(PIN) (1 << PIN)
#define ACD 7
#define OCIE1A 1
#undef X_STEP_PIN
#undef X_DIR_PIN
#undef X_MIN_PIN
#undef Y_STEP_PIN
#undef Y_DIR_PIN
#undef Y_MIN_PIN
#undef Z_STEP_PIN
#undef Z_DIR_PIN
#undef Z_MIN_PIN
#undef E_STEP_PIN
#undef E_DIR_PIN
#undef STEPPER_ENABLE_PIN
#undef HEATER_PIN
#undef FAN_PIN
#undef HEATER_PWM
#undef FAN_PWM
typedef enum {
X_STEP_PIN,
X_DIR_PIN,
X_MIN_PIN,
Y_STEP_PIN,
Y_DIR_PIN,
Y_MIN_PIN,
Z_STEP_PIN,
Z_DIR_PIN,
Z_MIN_PIN,
E_STEP_PIN,
E_DIR_PIN,
STEPPER_ENABLE_PIN,
SCK,
MOSI,
MISO,
SS,
PIN_NB
} pin_t;
#undef TEMP_PIN_CHANNEL
#define TEMP_PIN_CHANNEL 0
extern uint8_t ACSR;
extern uint8_t TIMSK1;
extern volatile bool sim_interrupts;
void WRITE(pin_t pin, bool on);
void SET_OUTPUT(pin_t pin);
void SET_INPUT(pin_t pin);
void sei(void);
#ifdef USE_WATCHDOG
#define wd_init()
#define wd_reset()
#endif
void sim_info(const char fmt[], ...);
void sim_error(const char msg[]);
void sim_assert(bool cond, const char msg[]);
#define ATOMIC_BLOCK(n) if (n)
#define ATOMIC_RESTORESTATE 1
#endif /* _SIMULATION_H */