1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2021 Ha Thach (tinyusb.org) for Adafruit Industries
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ */
24
+
25
+ #include " esp32-hal-gpio.h"
26
+ #include " pins_arduino.h"
27
+
28
+ extern " C"
29
+ {
30
+ // Initialize variant/board, called before setup()
31
+ void initVariant (void )
32
+ {
33
+ pinMode (LED_BUILTIN, OUTPUT);
34
+ pinMode (LED_STATUS, OUTPUT);
35
+
36
+ digitalWrite (LED_BUILTIN, HIGH);
37
+ digitalWrite (LED_STATUS, LOW);
38
+
39
+ // Set motor pins
40
+ pinMode (M1_PH, OUTPUT);
41
+ pinMode (M1_EN, OUTPUT);
42
+ pinMode (M2_PH, OUTPUT);
43
+ pinMode (M2_EN, OUTPUT);
44
+ pinMode (M3_PH, OUTPUT);
45
+ pinMode (M3_EN, OUTPUT);
46
+ pinMode (M4_PH, OUTPUT);
47
+ pinMode (M4_EN, OUTPUT);
48
+
49
+ // Set all to LOW
50
+ digitalWrite (M1_PH, LOW);
51
+ digitalWrite (M1_EN, LOW);
52
+ digitalWrite (M2_PH, LOW);
53
+ digitalWrite (M2_EN, LOW);
54
+ digitalWrite (M3_PH, LOW);
55
+ digitalWrite (M3_EN, LOW);
56
+ digitalWrite (M4_PH, LOW);
57
+ digitalWrite (M4_EN, LOW);
58
+ }
59
+ }
0 commit comments