-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathenvsetup.sh
99 lines (85 loc) · 2.25 KB
/
envsetup.sh
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/sh
# mkr1000 appears to work with a SEEED XIAO SAMD21 board
siot_mcu_board=arduino:samd:mkr1000
siot_mcu_port=/dev/ttyACM1
#siot_mcu_board=arduino:avr:uno
siot_setup() {
git submodule update --init
arduino-cli lib install PacketSerial
arduino-cli core install arduino:samd
}
siot_protobuf_gen() {
(cd libraries/pb && python ../../nanopb/generator/nanopb_generator.py ./*.proto)
}
siot_ctags() {
arduino-ctags -R
}
# the following function needs to be run any time you update nanopb
# to copy the library files to where arduino-cli can find them.
siot_install_nanopb_library() {
cp nanopb/*.h libraries/nanopb/
cp nanopb/*.c libraries/nanopb/
}
siot_build_siot_mcu_serial() {
arduino-cli compile \
Arduino/siot-mcu-serial \
--libraries libraries \
-b $siot_mcu_board
}
siot_upload_siot_mcu_serial() {
siot_build_siot_mcu_serial &&
arduino-cli upload \
Arduino/siot-mcu-serial \
-b $siot_mcu_board \
-p $siot_mcu_port
}
siot_build_siot_mcu_cobs() {
arduino-cli compile \
Arduino/siot-mcu-cobs \
-b $siot_mcu_board
}
siot_upload_siot_mcu_cobs() {
siot_build_siot_mcu_cobs &&
arduino-cli upload \
Arduino/siot-mcu-cobs \
-b $siot_mcu_board \
-p $siot_mcu_port
}
siot_build_siot_mcu_serial_hr() {
arduino-cli compile \
Arduino/siot-mcu-serial-hr \
--libraries libraries \
-b $siot_mcu_board
}
siot_upload_siot_mcu_serial_hr() {
siot_build_siot_mcu_serial_hr &&
arduino-cli upload \
Arduino/siot-mcu-serial-hr \
-b $siot_mcu_board \
-p $siot_mcu_port
}
siot_build_siot_mcu_serial_hr_fixed() {
arduino-cli compile \
Arduino/siot-mcu-serial-hr-fixed \
--libraries libraries \
-b $siot_mcu_board
}
siot_upload_siot_mcu_serial_hr_fixed() {
siot_build_siot_mcu_serial_hr_fixed &&
arduino-cli upload \
Arduino/siot-mcu-serial-hr-fixed \
-b $siot_mcu_board \
-p $siot_mcu_port
}
siot_pb_test_run() {
(cd cmd/pb-test && gcc -I ../../libraries/pb \
-I ../../libraries/nanopb \
-o pb-test \
../../libraries/nanopb/pb_common.c \
../../libraries/nanopb/pb_encode.c \
../../libraries/pb/point.pb.c \
../../libraries/pb/timestamp.pb.c \
../../libraries/pb/siot_serial.pb.c \
main.c &&
./pb-test)
}