-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathplatform.h
executable file
·63 lines (51 loc) · 913 Bytes
/
platform.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
//#pragma once
#ifndef platform_H
#define platform_H
#ifdef ARDUINO
#include<Arduino.h>
#endif
// if platformio cannot detect then force it
//#define STM32
//#define ESP32
//#define ESP8266
#ifdef ESP8266
#define D0 16
#define D1 5
#define D2 4
#define D3 0
#define D4 2
#define D5 14
#define D6 12
#define D7 13
#define D8 15
#define D9 3
#define D10 1
#define TX 1
#define RX 3
#endif
#ifdef ESP32
#warning Detected ESP32
//#define ESP8266
#endif
#if defined(ESP32) || defined (ESP8266)
extern int HEATING;
//#include "motors.h"
#ifdef laser_pin
#define LASER(x) {xdigitalWrite(laser_pin,x);}
#else
#define LASER(x) {}
#endif
#ifdef spindle_pin
#define SPINDLE(v) {set_pwm(v); }
#else
#define SPINDLE(v) {}
#endif
#ifdef heater_pin
#define HEATER(x) {xdigitalWrite(heater_pin,x);}
#else
#define HEATER(x) {}
#endif
#else
#warning Unsupported CPU
#endif
#endif