@@ -22,36 +22,40 @@ import (
22
22
"github.com/stretchr/testify/require"
23
23
)
24
24
25
+ var boardUnoProperties = properties .NewMap ()
26
+
27
+ func init () {
28
+ boardUnoProperties .Set ("name" , "Arduino/Genuino Uno" )
29
+ boardUnoProperties .Set ("vid.0" , "0x2341" )
30
+ boardUnoProperties .Set ("pid.0" , "0x0043" )
31
+ boardUnoProperties .Set ("vid.1" , "0x2341" )
32
+ boardUnoProperties .Set ("pid.1" , "0x0001" )
33
+ boardUnoProperties .Set ("vid.2" , "0x2A03" )
34
+ boardUnoProperties .Set ("pid.2" , "0x0043" )
35
+ boardUnoProperties .Set ("vid.3" , "0x2341" )
36
+ boardUnoProperties .Set ("pid.3" , "0x0243" )
37
+ boardUnoProperties .Set ("upload.tool" , "avrdude" )
38
+ boardUnoProperties .Set ("upload.protocol" , "arduino" )
39
+ boardUnoProperties .Set ("upload.maximum_size" , "32256" )
40
+ boardUnoProperties .Set ("upload.maximum_data_size" , "2048" )
41
+ boardUnoProperties .Set ("upload.speed" , "115200" )
42
+ boardUnoProperties .Set ("bootloader.tool" , "avrdude" )
43
+ boardUnoProperties .Set ("bootloader.low_fuses" , "0xFF" )
44
+ boardUnoProperties .Set ("bootloader.high_fuses" , "0xDE" )
45
+ boardUnoProperties .Set ("bootloader.extended_fuses" , "0xFD" )
46
+ boardUnoProperties .Set ("bootloader.unlock_bits" , "0x3F" )
47
+ boardUnoProperties .Set ("bootloader.lock_bits" , "0x0F" )
48
+ boardUnoProperties .Set ("bootloader.file" , "optiboot/optiboot_atmega328.hex" )
49
+ boardUnoProperties .Set ("build.mcu" , "atmega328p" )
50
+ boardUnoProperties .Set ("build.f_cpu" , "16000000L" )
51
+ boardUnoProperties .Set ("build.board" , "AVR_UNO" )
52
+ boardUnoProperties .Set ("build.core" , "arduino" )
53
+ boardUnoProperties .Set ("build.variant" , "standard" )
54
+ }
55
+
25
56
var boardUno = & Board {
26
- BoardID : "uno" ,
27
- Properties : properties .NewFromHashmap (map [string ]string {
28
- "name" : "Arduino/Genuino Uno" ,
29
- "vid.0" : "0x2341" ,
30
- "pid.0" : "0x0043" ,
31
- "vid.1" : "0x2341" ,
32
- "pid.1" : "0x0001" ,
33
- "vid.2" : "0x2A03" ,
34
- "pid.2" : "0x0043" ,
35
- "vid.3" : "0x2341" ,
36
- "pid.3" : "0x0243" ,
37
- "upload.tool" : "avrdude" ,
38
- "upload.protocol" : "arduino" ,
39
- "upload.maximum_size" : "32256" ,
40
- "upload.maximum_data_size" : "2048" ,
41
- "upload.speed" : "115200" ,
42
- "bootloader.tool" : "avrdude" ,
43
- "bootloader.low_fuses" : "0xFF" ,
44
- "bootloader.high_fuses" : "0xDE" ,
45
- "bootloader.extended_fuses" : "0xFD" ,
46
- "bootloader.unlock_bits" : "0x3F" ,
47
- "bootloader.lock_bits" : "0x0F" ,
48
- "bootloader.file" : "optiboot/optiboot_atmega328.hex" ,
49
- "build.mcu" : "atmega328p" ,
50
- "build.f_cpu" : "16000000L" ,
51
- "build.board" : "AVR_UNO" ,
52
- "build.core" : "arduino" ,
53
- "build.variant" : "standard" ,
54
- }),
57
+ BoardID : "uno" ,
58
+ Properties : boardUnoProperties ,
55
59
PlatformRelease : & PlatformRelease {
56
60
Platform : & Platform {
57
61
Architecture : "avr" ,
@@ -63,51 +67,56 @@ var boardUno = &Board{
63
67
},
64
68
}
65
69
70
+ var boardMegaProperties = properties .NewMap ()
71
+
72
+ func init () {
73
+ boardMegaProperties .Set ("name" , "Arduino/Genuino Mega or Mega 2560" )
74
+ boardMegaProperties .Set ("vid.0" , "0x2341" )
75
+ boardMegaProperties .Set ("pid.0" , "0x0010" )
76
+ boardMegaProperties .Set ("vid.1" , "0x2341" )
77
+ boardMegaProperties .Set ("pid.1" , "0x0042" )
78
+ boardMegaProperties .Set ("vid.2" , "0x2A03" )
79
+ boardMegaProperties .Set ("pid.2" , "0x0010" )
80
+ boardMegaProperties .Set ("vid.3" , "0x2A03" )
81
+ boardMegaProperties .Set ("pid.3" , "0x0042" )
82
+ boardMegaProperties .Set ("vid.4" , "0x2341" )
83
+ boardMegaProperties .Set ("pid.4" , "0x0210" )
84
+ boardMegaProperties .Set ("vid.5" , "0x2341" )
85
+ boardMegaProperties .Set ("pid.5" , "0x0242" )
86
+ boardMegaProperties .Set ("upload.tool" , "avrdude" )
87
+ boardMegaProperties .Set ("upload.maximum_data_size" , "8192" )
88
+ boardMegaProperties .Set ("bootloader.tool" , "avrdude" )
89
+ boardMegaProperties .Set ("bootloader.low_fuses" , "0xFF" )
90
+ boardMegaProperties .Set ("bootloader.unlock_bits" , "0x3F" )
91
+ boardMegaProperties .Set ("bootloader.lock_bits" , "0x0F" )
92
+ boardMegaProperties .Set ("build.f_cpu" , "16000000L" )
93
+ boardMegaProperties .Set ("build.core" , "arduino" )
94
+ boardMegaProperties .Set ("build.variant" , "mega" )
95
+ boardMegaProperties .Set ("build.board" , "AVR_MEGA2560" )
96
+ boardMegaProperties .Set ("menu.cpu.atmega2560" , "ATmega2560 (Mega 2560)" )
97
+ boardMegaProperties .Set ("menu.cpu.atmega2560.upload.protocol" , "wiring" )
98
+ boardMegaProperties .Set ("menu.cpu.atmega2560.upload.maximum_size" , "253952" )
99
+ boardMegaProperties .Set ("menu.cpu.atmega2560.upload.speed" , "115200" )
100
+ boardMegaProperties .Set ("menu.cpu.atmega2560.bootloader.high_fuses" , "0xD8" )
101
+ boardMegaProperties .Set ("menu.cpu.atmega2560.bootloader.extended_fuses" , "0xFD" )
102
+ boardMegaProperties .Set ("menu.cpu.atmega2560.bootloader.file" , "stk500v2/stk500boot_v2_mega2560.hex" )
103
+ boardMegaProperties .Set ("menu.cpu.atmega2560.build.mcu" , "atmega2560" )
104
+ boardMegaProperties .Set ("menu.cpu.atmega2560.build.board" , "AVR_MEGA2560" )
105
+ boardMegaProperties .Set ("menu.cpu.atmega1280" , "ATmega1280" )
106
+ boardMegaProperties .Set ("menu.cpu.atmega1280.upload.protocol" , "arduino" )
107
+ boardMegaProperties .Set ("menu.cpu.atmega1280.upload.maximum_size" , "126976" )
108
+ boardMegaProperties .Set ("menu.cpu.atmega1280.upload.speed" , "57600" )
109
+ boardMegaProperties .Set ("menu.cpu.atmega1280.bootloader.high_fuses" , "0xDA" )
110
+ boardMegaProperties .Set ("menu.cpu.atmega1280.bootloader.extended_fuses" , "0xF5" )
111
+ boardMegaProperties .Set ("menu.cpu.atmega1280.bootloader.file" , "atmega/ATmegaBOOT_168_atmega1280.hex" )
112
+ boardMegaProperties .Set ("menu.cpu.atmega1280.build.mcu" , "atmega1280" )
113
+ boardMegaProperties .Set ("menu.cpu.atmega1280.build.board" , "AVR_MEGA" )
114
+ }
115
+
66
116
var boardMega = & Board {
67
- BoardID : "mega" ,
68
- Properties : properties .NewFromHashmap (map [string ]string {
69
- "name" : "Arduino/Genuino Mega or Mega 2560" ,
70
- "vid.0" : "0x2341" ,
71
- "pid.0" : "0x0010" ,
72
- "vid.1" : "0x2341" ,
73
- "pid.1" : "0x0042" ,
74
- "vid.2" : "0x2A03" ,
75
- "pid.2" : "0x0010" ,
76
- "vid.3" : "0x2A03" ,
77
- "pid.3" : "0x0042" ,
78
- "vid.4" : "0x2341" ,
79
- "pid.4" : "0x0210" ,
80
- "vid.5" : "0x2341" ,
81
- "pid.5" : "0x0242" ,
82
- "upload.tool" : "avrdude" ,
83
- "upload.maximum_data_size" : "8192" ,
84
- "bootloader.tool" : "avrdude" ,
85
- "bootloader.low_fuses" : "0xFF" ,
86
- "bootloader.unlock_bits" : "0x3F" ,
87
- "bootloader.lock_bits" : "0x0F" ,
88
- "build.f_cpu" : "16000000L" ,
89
- "build.core" : "arduino" ,
90
- "build.variant" : "mega" ,
91
- "build.board" : "AVR_MEGA2560" ,
92
- "menu.cpu.atmega2560" : "ATmega2560 (Mega 2560)" ,
93
- "menu.cpu.atmega2560.upload.protocol" : "wiring" ,
94
- "menu.cpu.atmega2560.upload.maximum_size" : "253952" ,
95
- "menu.cpu.atmega2560.upload.speed" : "115200" ,
96
- "menu.cpu.atmega2560.bootloader.high_fuses" : "0xD8" ,
97
- "menu.cpu.atmega2560.bootloader.extended_fuses" : "0xFD" ,
98
- "menu.cpu.atmega2560.bootloader.file" : "stk500v2/stk500boot_v2_mega2560.hex" ,
99
- "menu.cpu.atmega2560.build.mcu" : "atmega2560" ,
100
- "menu.cpu.atmega2560.build.board" : "AVR_MEGA2560" ,
101
- "menu.cpu.atmega1280" : "ATmega1280" ,
102
- "menu.cpu.atmega1280.upload.protocol" : "arduino" ,
103
- "menu.cpu.atmega1280.upload.maximum_size" : "126976" ,
104
- "menu.cpu.atmega1280.upload.speed" : "57600" ,
105
- "menu.cpu.atmega1280.bootloader.high_fuses" : "0xDA" ,
106
- "menu.cpu.atmega1280.bootloader.extended_fuses" : "0xF5" ,
107
- "menu.cpu.atmega1280.bootloader.file" : "atmega/ATmegaBOOT_168_atmega1280.hex" ,
108
- "menu.cpu.atmega1280.build.mcu" : "atmega1280" ,
109
- "menu.cpu.atmega1280.build.board" : "AVR_MEGA" ,
110
- }),
117
+ BoardID : "mega" ,
118
+ Properties : boardMegaProperties ,
119
+
111
120
PlatformRelease : & PlatformRelease {
112
121
Platform : & Platform {
113
122
Architecture : "avr" ,
@@ -121,36 +130,41 @@ var boardMega = &Board{
121
130
},
122
131
}
123
132
133
+ var boardWatterottTiny841Properties = properties .NewMap ()
134
+
135
+ func init () {
136
+ boardWatterottTiny841Properties .Set ("name" , "ATtiny841 (8 MHz)" )
137
+ boardWatterottTiny841Properties .Set ("menu.core.arduino" , "Standard Arduino" )
138
+ boardWatterottTiny841Properties .Set ("menu.core.arduino.build.core" , "arduino:arduino" )
139
+ boardWatterottTiny841Properties .Set ("menu.core.arduino.build.variant" , "tiny14" )
140
+ boardWatterottTiny841Properties .Set ("menu.core.spencekonde" , "ATtiny841 (by Spence Konde)" )
141
+ boardWatterottTiny841Properties .Set ("menu.core.spencekonde.build.core" , "tiny841" )
142
+ boardWatterottTiny841Properties .Set ("menu.core.spencekonde.build.variant" , "tiny14" )
143
+ boardWatterottTiny841Properties .Set ("menu.info.info" , "Press Reset, when Uploading is shown." )
144
+ boardWatterottTiny841Properties .Set ("vid.0" , "0x16D0" )
145
+ boardWatterottTiny841Properties .Set ("pid.0" , "0x0753" )
146
+ boardWatterottTiny841Properties .Set ("bootloader.tool" , "avrdude" )
147
+ boardWatterottTiny841Properties .Set ("bootloader.low_fuses" , "0xE2" )
148
+ boardWatterottTiny841Properties .Set ("bootloader.high_fuses" , "0xDD" )
149
+ boardWatterottTiny841Properties .Set ("bootloader.extended_fuses" , "0xFE" )
150
+ boardWatterottTiny841Properties .Set ("bootloader.unlock_bits" , "0xFF" )
151
+ boardWatterottTiny841Properties .Set ("bootloader.lock_bits" , "0xFF" )
152
+ boardWatterottTiny841Properties .Set ("bootloader.file" , "micronucleus-t841.hex" )
153
+ boardWatterottTiny841Properties .Set ("upload.tool" , "micronucleus" )
154
+ boardWatterottTiny841Properties .Set ("upload.protocol" , "usb" )
155
+ boardWatterottTiny841Properties .Set ("upload.wait_for_upload_port" , "false" )
156
+ boardWatterottTiny841Properties .Set ("upload.use_1200bps_touch" , "false" )
157
+ boardWatterottTiny841Properties .Set ("upload.disable_flushing" , "false" )
158
+ boardWatterottTiny841Properties .Set ("upload.maximum_size" , "6500" )
159
+ boardWatterottTiny841Properties .Set ("build.mcu" , "attiny841" )
160
+ boardWatterottTiny841Properties .Set ("build.f_cpu" , "8000000L" )
161
+ boardWatterottTiny841Properties .Set ("build.board" , "AVR_ATTINY841" )
162
+
163
+ }
164
+
124
165
var boardWatterottTiny841 = & Board {
125
- BoardID : "attiny841" ,
126
- Properties : properties .NewFromHashmap (map [string ]string {
127
- "name" : "ATtiny841 (8 MHz)" ,
128
- "menu.core.arduino" : "Standard Arduino" ,
129
- "menu.core.arduino.build.core" : "arduino:arduino" ,
130
- "menu.core.arduino.build.variant" : "tiny14" ,
131
- "menu.core.spencekonde" : "ATtiny841 (by Spence Konde)" ,
132
- "menu.core.spencekonde.build.core" : "tiny841" ,
133
- "menu.core.spencekonde.build.variant" : "tiny14" ,
134
- "menu.info.info" : "Press Reset, when Uploading is shown." ,
135
- "vid.0" : "0x16D0" ,
136
- "pid.0" : "0x0753" ,
137
- "bootloader.tool" : "avrdude" ,
138
- "bootloader.low_fuses" : "0xE2" ,
139
- "bootloader.high_fuses" : "0xDD" ,
140
- "bootloader.extended_fuses" : "0xFE" ,
141
- "bootloader.unlock_bits" : "0xFF" ,
142
- "bootloader.lock_bits" : "0xFF" ,
143
- "bootloader.file" : "micronucleus-t841.hex" ,
144
- "upload.tool" : "micronucleus" ,
145
- "upload.protocol" : "usb" ,
146
- "upload.wait_for_upload_port" : "false" ,
147
- "upload.use_1200bps_touch" : "false" ,
148
- "upload.disable_flushing" : "false" ,
149
- "upload.maximum_size" : "6500" ,
150
- "build.mcu" : "attiny841" ,
151
- "build.f_cpu" : "8000000L" ,
152
- "build.board" : "AVR_ATTINY841" ,
153
- }),
166
+ BoardID : "attiny841" ,
167
+ Properties : boardWatterottTiny841Properties ,
154
168
PlatformRelease : & PlatformRelease {
155
169
Platform : & Platform {
156
170
Architecture : "avr" ,
@@ -194,111 +208,114 @@ func TestBoard(t *testing.T) {
194
208
}
195
209
196
210
func TestBoardOptions (t * testing.T ) {
197
- expConf2560 := properties .NewFromHashmap (map [string ]string {
198
- "bootloader.extended_fuses" : "0xFD" ,
199
- "bootloader.file" : "stk500v2/stk500boot_v2_mega2560.hex" ,
200
- "bootloader.high_fuses" : "0xD8" ,
201
- "bootloader.lock_bits" : "0x0F" ,
202
- "bootloader.low_fuses" : "0xFF" ,
203
- "bootloader.tool" : "avrdude" ,
204
- "bootloader.unlock_bits" : "0x3F" ,
205
- "build.board" : "AVR_MEGA2560" ,
206
- "build.core" : "arduino" ,
207
- "build.f_cpu" : "16000000L" ,
208
- "build.mcu" : "atmega2560" ,
209
- "build.variant" : "mega" ,
210
- "menu.cpu.atmega1280" : "ATmega1280" ,
211
- "menu.cpu.atmega1280.bootloader.extended_fuses" : "0xF5" ,
212
- "menu.cpu.atmega1280.bootloader.file" : "atmega/ATmegaBOOT_168_atmega1280.hex" ,
213
- "menu.cpu.atmega1280.bootloader.high_fuses" : "0xDA" ,
214
- "menu.cpu.atmega1280.build.board" : "AVR_MEGA" ,
215
- "menu.cpu.atmega1280.build.mcu" : "atmega1280" ,
216
- "menu.cpu.atmega1280.upload.maximum_size" : "126976" ,
217
- "menu.cpu.atmega1280.upload.protocol" : "arduino" ,
218
- "menu.cpu.atmega1280.upload.speed" : "57600" ,
219
- "menu.cpu.atmega2560" : "ATmega2560 (Mega 2560)" ,
220
- "menu.cpu.atmega2560.bootloader.extended_fuses" : "0xFD" ,
221
- "menu.cpu.atmega2560.bootloader.file" : "stk500v2/stk500boot_v2_mega2560.hex" ,
222
- "menu.cpu.atmega2560.bootloader.high_fuses" : "0xD8" ,
223
- "menu.cpu.atmega2560.build.board" : "AVR_MEGA2560" ,
224
- "menu.cpu.atmega2560.build.mcu" : "atmega2560" ,
225
- "menu.cpu.atmega2560.upload.maximum_size" : "253952" ,
226
- "menu.cpu.atmega2560.upload.protocol" : "wiring" ,
227
- "menu.cpu.atmega2560.upload.speed" : "115200" ,
228
- "name" : "Arduino/Genuino Mega or Mega 2560" ,
229
- "pid.0" : "0x0010" ,
230
- "pid.1" : "0x0042" ,
231
- "pid.2" : "0x0010" ,
232
- "pid.3" : "0x0042" ,
233
- "pid.4" : "0x0210" ,
234
- "pid.5" : "0x0242" ,
235
- "upload.maximum_data_size" : "8192" ,
236
- "upload.maximum_size" : "253952" ,
237
- "upload.protocol" : "wiring" ,
238
- "upload.speed" : "115200" ,
239
- "upload.tool" : "avrdude" ,
240
- "vid.0" : "0x2341" ,
241
- "vid.1" : "0x2341" ,
242
- "vid.2" : "0x2A03" ,
243
- "vid.3" : "0x2A03" ,
244
- "vid.4" : "0x2341" ,
245
- "vid.5" : "0x2341" ,
246
- })
211
+ expConf2560 := properties .NewMap ()
212
+ expConf2560 .Set ("bootloader.extended_fuses" , "0xFD" )
213
+ expConf2560 .Set ("bootloader.file" , "stk500v2/stk500boot_v2_mega2560.hex" )
214
+ expConf2560 .Set ("bootloader.high_fuses" , "0xD8" )
215
+ expConf2560 .Set ("bootloader.lock_bits" , "0x0F" )
216
+ expConf2560 .Set ("bootloader.low_fuses" , "0xFF" )
217
+ expConf2560 .Set ("bootloader.tool" , "avrdude" )
218
+ expConf2560 .Set ("bootloader.unlock_bits" , "0x3F" )
219
+ expConf2560 .Set ("build.board" , "AVR_MEGA2560" )
220
+ expConf2560 .Set ("build.core" , "arduino" )
221
+ expConf2560 .Set ("build.f_cpu" , "16000000L" )
222
+ expConf2560 .Set ("build.mcu" , "atmega2560" )
223
+ expConf2560 .Set ("build.variant" , "mega" )
224
+ expConf2560 .Set ("menu.cpu.atmega1280" , "ATmega1280" )
225
+ expConf2560 .Set ("menu.cpu.atmega1280.bootloader.extended_fuses" , "0xF5" )
226
+ expConf2560 .Set ("menu.cpu.atmega1280.bootloader.file" , "atmega/ATmegaBOOT_168_atmega1280.hex" )
227
+ expConf2560 .Set ("menu.cpu.atmega1280.bootloader.high_fuses" , "0xDA" )
228
+ expConf2560 .Set ("menu.cpu.atmega1280.build.board" , "AVR_MEGA" )
229
+ expConf2560 .Set ("menu.cpu.atmega1280.build.mcu" , "atmega1280" )
230
+ expConf2560 .Set ("menu.cpu.atmega1280.upload.maximum_size" , "126976" )
231
+ expConf2560 .Set ("menu.cpu.atmega1280.upload.protocol" , "arduino" )
232
+ expConf2560 .Set ("menu.cpu.atmega1280.upload.speed" , "57600" )
233
+ expConf2560 .Set ("menu.cpu.atmega2560" , "ATmega2560 (Mega 2560)" )
234
+ expConf2560 .Set ("menu.cpu.atmega2560.bootloader.extended_fuses" , "0xFD" )
235
+ expConf2560 .Set ("menu.cpu.atmega2560.bootloader.file" , "stk500v2/stk500boot_v2_mega2560.hex" )
236
+ expConf2560 .Set ("menu.cpu.atmega2560.bootloader.high_fuses" , "0xD8" )
237
+ expConf2560 .Set ("menu.cpu.atmega2560.build.board" , "AVR_MEGA2560" )
238
+ expConf2560 .Set ("menu.cpu.atmega2560.build.mcu" , "atmega2560" )
239
+ expConf2560 .Set ("menu.cpu.atmega2560.upload.maximum_size" , "253952" )
240
+ expConf2560 .Set ("menu.cpu.atmega2560.upload.protocol" , "wiring" )
241
+ expConf2560 .Set ("menu.cpu.atmega2560.upload.speed" , "115200" )
242
+ expConf2560 .Set ("name" , "Arduino/Genuino Mega or Mega 2560" )
243
+ expConf2560 .Set ("pid.0" , "0x0010" )
244
+ expConf2560 .Set ("pid.1" , "0x0042" )
245
+ expConf2560 .Set ("pid.2" , "0x0010" )
246
+ expConf2560 .Set ("pid.3" , "0x0042" )
247
+ expConf2560 .Set ("pid.4" , "0x0210" )
248
+ expConf2560 .Set ("pid.5" , "0x0242" )
249
+ expConf2560 .Set ("upload.maximum_data_size" , "8192" )
250
+ expConf2560 .Set ("upload.maximum_size" , "253952" )
251
+ expConf2560 .Set ("upload.protocol" , "wiring" )
252
+ expConf2560 .Set ("upload.speed" , "115200" )
253
+ expConf2560 .Set ("upload.tool" , "avrdude" )
254
+ expConf2560 .Set ("vid.0" , "0x2341" )
255
+ expConf2560 .Set ("vid.1" , "0x2341" )
256
+ expConf2560 .Set ("vid.2" , "0x2A03" )
257
+ expConf2560 .Set ("vid.3" , "0x2A03" )
258
+ expConf2560 .Set ("vid.4" , "0x2341" )
259
+ expConf2560 .Set ("vid.5" , "0x2341" )
247
260
248
261
conf2560 , err := boardMega .GeneratePropertiesForConfiguration ("cpu=atmega2560" )
249
262
require .NoError (t , err , "generating cpu=atmega2560 configuration" )
250
263
require .EqualValues (t , expConf2560 .AsMap (), conf2560 .AsMap (), "configuration for cpu=atmega2560" )
251
-
252
- expConf1280 := properties .NewFromHashmap (map [string ]string {
253
- "bootloader.extended_fuses" : "0xF5" ,
254
- "bootloader.file" : "atmega/ATmegaBOOT_168_atmega1280.hex" ,
255
- "bootloader.high_fuses" : "0xDA" ,
256
- "bootloader.lock_bits" : "0x0F" ,
257
- "bootloader.low_fuses" : "0xFF" ,
258
- "bootloader.tool" : "avrdude" ,
259
- "bootloader.unlock_bits" : "0x3F" ,
260
- "build.board" : "AVR_MEGA" ,
261
- "build.core" : "arduino" ,
262
- "build.f_cpu" : "16000000L" ,
263
- "build.mcu" : "atmega1280" ,
264
- "build.variant" : "mega" ,
265
- "menu.cpu.atmega1280" : "ATmega1280" ,
266
- "menu.cpu.atmega1280.bootloader.extended_fuses" : "0xF5" ,
267
- "menu.cpu.atmega1280.bootloader.file" : "atmega/ATmegaBOOT_168_atmega1280.hex" ,
268
- "menu.cpu.atmega1280.bootloader.high_fuses" : "0xDA" ,
269
- "menu.cpu.atmega1280.build.board" : "AVR_MEGA" ,
270
- "menu.cpu.atmega1280.build.mcu" : "atmega1280" ,
271
- "menu.cpu.atmega1280.upload.maximum_size" : "126976" ,
272
- "menu.cpu.atmega1280.upload.protocol" : "arduino" ,
273
- "menu.cpu.atmega1280.upload.speed" : "57600" ,
274
- "menu.cpu.atmega2560" : "ATmega2560 (Mega 2560)" ,
275
- "menu.cpu.atmega2560.bootloader.extended_fuses" : "0xFD" ,
276
- "menu.cpu.atmega2560.bootloader.file" : "stk500v2/stk500boot_v2_mega2560.hex" ,
277
- "menu.cpu.atmega2560.bootloader.high_fuses" : "0xD8" ,
278
- "menu.cpu.atmega2560.build.board" : "AVR_MEGA2560" ,
279
- "menu.cpu.atmega2560.build.mcu" : "atmega2560" ,
280
- "menu.cpu.atmega2560.upload.maximum_size" : "253952" ,
281
- "menu.cpu.atmega2560.upload.protocol" : "wiring" ,
282
- "menu.cpu.atmega2560.upload.speed" : "115200" ,
283
- "name" : "Arduino/Genuino Mega or Mega 2560" ,
284
- "pid.0" : "0x0010" ,
285
- "pid.1" : "0x0042" ,
286
- "pid.2" : "0x0010" ,
287
- "pid.3" : "0x0042" ,
288
- "pid.4" : "0x0210" ,
289
- "pid.5" : "0x0242" ,
290
- "upload.maximum_data_size" : "8192" ,
291
- "upload.maximum_size" : "126976" ,
292
- "upload.protocol" : "arduino" ,
293
- "upload.speed" : "57600" ,
294
- "upload.tool" : "avrdude" ,
295
- "vid.0" : "0x2341" ,
296
- "vid.1" : "0x2341" ,
297
- "vid.2" : "0x2A03" ,
298
- "vid.3" : "0x2A03" ,
299
- "vid.4" : "0x2341" ,
300
- "vid.5" : "0x2341" ,
301
- })
264
+ require .EqualValues (t , map [string ]string {"cpu" : "Processor" }, boardMega .GetConfigOptions ().AsMap ())
265
+ require .EqualValues (t , map [string ]string {
266
+ "atmega1280" : "ATmega1280" ,
267
+ "atmega2560" : "ATmega2560 (Mega 2560)" ,
268
+ }, boardMega .GetConfigOptionValues ("cpu" ).AsMap ())
269
+ require .EqualValues (t , map [string ]string {"cpu" : "atmega2560" }, boardMega .defaultConfig .AsMap ())
270
+ expConf1280 := properties .NewMap ()
271
+ expConf1280 .Set ("bootloader.extended_fuses" , "0xF5" )
272
+ expConf1280 .Set ("bootloader.file" , "atmega/ATmegaBOOT_168_atmega1280.hex" )
273
+ expConf1280 .Set ("bootloader.high_fuses" , "0xDA" )
274
+ expConf1280 .Set ("bootloader.lock_bits" , "0x0F" )
275
+ expConf1280 .Set ("bootloader.low_fuses" , "0xFF" )
276
+ expConf1280 .Set ("bootloader.tool" , "avrdude" )
277
+ expConf1280 .Set ("bootloader.unlock_bits" , "0x3F" )
278
+ expConf1280 .Set ("build.board" , "AVR_MEGA" )
279
+ expConf1280 .Set ("build.core" , "arduino" )
280
+ expConf1280 .Set ("build.f_cpu" , "16000000L" )
281
+ expConf1280 .Set ("build.mcu" , "atmega1280" )
282
+ expConf1280 .Set ("build.variant" , "mega" )
283
+ expConf1280 .Set ("menu.cpu.atmega1280" , "ATmega1280" )
284
+ expConf1280 .Set ("menu.cpu.atmega1280.bootloader.extended_fuses" , "0xF5" )
285
+ expConf1280 .Set ("menu.cpu.atmega1280.bootloader.file" , "atmega/ATmegaBOOT_168_atmega1280.hex" )
286
+ expConf1280 .Set ("menu.cpu.atmega1280.bootloader.high_fuses" , "0xDA" )
287
+ expConf1280 .Set ("menu.cpu.atmega1280.build.board" , "AVR_MEGA" )
288
+ expConf1280 .Set ("menu.cpu.atmega1280.build.mcu" , "atmega1280" )
289
+ expConf1280 .Set ("menu.cpu.atmega1280.upload.maximum_size" , "126976" )
290
+ expConf1280 .Set ("menu.cpu.atmega1280.upload.protocol" , "arduino" )
291
+ expConf1280 .Set ("menu.cpu.atmega1280.upload.speed" , "57600" )
292
+ expConf1280 .Set ("menu.cpu.atmega2560" , "ATmega2560 (Mega 2560)" )
293
+ expConf1280 .Set ("menu.cpu.atmega2560.bootloader.extended_fuses" , "0xFD" )
294
+ expConf1280 .Set ("menu.cpu.atmega2560.bootloader.file" , "stk500v2/stk500boot_v2_mega2560.hex" )
295
+ expConf1280 .Set ("menu.cpu.atmega2560.bootloader.high_fuses" , "0xD8" )
296
+ expConf1280 .Set ("menu.cpu.atmega2560.build.board" , "AVR_MEGA2560" )
297
+ expConf1280 .Set ("menu.cpu.atmega2560.build.mcu" , "atmega2560" )
298
+ expConf1280 .Set ("menu.cpu.atmega2560.upload.maximum_size" , "253952" )
299
+ expConf1280 .Set ("menu.cpu.atmega2560.upload.protocol" , "wiring" )
300
+ expConf1280 .Set ("menu.cpu.atmega2560.upload.speed" , "115200" )
301
+ expConf1280 .Set ("name" , "Arduino/Genuino Mega or Mega 2560" )
302
+ expConf1280 .Set ("pid.0" , "0x0010" )
303
+ expConf1280 .Set ("pid.1" , "0x0042" )
304
+ expConf1280 .Set ("pid.2" , "0x0010" )
305
+ expConf1280 .Set ("pid.3" , "0x0042" )
306
+ expConf1280 .Set ("pid.4" , "0x0210" )
307
+ expConf1280 .Set ("pid.5" , "0x0242" )
308
+ expConf1280 .Set ("upload.maximum_data_size" , "8192" )
309
+ expConf1280 .Set ("upload.maximum_size" , "126976" )
310
+ expConf1280 .Set ("upload.protocol" , "arduino" )
311
+ expConf1280 .Set ("upload.speed" , "57600" )
312
+ expConf1280 .Set ("upload.tool" , "avrdude" )
313
+ expConf1280 .Set ("vid.0" , "0x2341" )
314
+ expConf1280 .Set ("vid.1" , "0x2341" )
315
+ expConf1280 .Set ("vid.2" , "0x2A03" )
316
+ expConf1280 .Set ("vid.3" , "0x2A03" )
317
+ expConf1280 .Set ("vid.4" , "0x2341" )
318
+ expConf1280 .Set ("vid.5" , "0x2341" )
302
319
conf1280 , err := boardMega .GeneratePropertiesForConfiguration ("cpu=atmega1280" )
303
320
require .NoError (t , err , "generating cpu=atmega1280 configuration" )
304
321
require .EqualValues (t , expConf1280 .AsMap (), conf1280 .AsMap (), "configuration for cpu=atmega1280" )
@@ -309,36 +326,35 @@ func TestBoardOptions(t *testing.T) {
309
326
_ , err = boardUno .GeneratePropertiesForConfiguration ("cpu=atmega1280" )
310
327
require .Error (t , err , "generating cpu=atmega1280 configuration" )
311
328
312
- expWatterott := properties .NewFromHashmap (map [string ]string {
313
- "bootloader.extended_fuses" : "0xFE" ,
314
- "bootloader.file" : "micronucleus-t841.hex" ,
315
- "bootloader.high_fuses" : "0xDD" ,
316
- "bootloader.lock_bits" : "0xFF" ,
317
- "bootloader.low_fuses" : "0xE2" ,
318
- "bootloader.tool" : "avrdude" ,
319
- "bootloader.unlock_bits" : "0xFF" ,
320
- "build.board" : "AVR_ATTINY841" ,
321
- "build.core" : "tiny841" ,
322
- "build.f_cpu" : "8000000L" ,
323
- "build.mcu" : "attiny841" ,
324
- "build.variant" : "tiny14" ,
325
- "menu.core.arduino" : "Standard Arduino" ,
326
- "menu.core.arduino.build.core" : "arduino:arduino" ,
327
- "menu.core.arduino.build.variant" : "tiny14" ,
328
- "menu.core.spencekonde" : "ATtiny841 (by Spence Konde)" ,
329
- "menu.core.spencekonde.build.core" : "tiny841" ,
330
- "menu.core.spencekonde.build.variant" : "tiny14" ,
331
- "menu.info.info" : "Press Reset, when Uploading is shown." ,
332
- "name" : "ATtiny841 (8 MHz)" ,
333
- "pid.0" : "0x0753" ,
334
- "upload.disable_flushing" : "false" ,
335
- "upload.maximum_size" : "6500" ,
336
- "upload.protocol" : "usb" ,
337
- "upload.tool" : "micronucleus" ,
338
- "upload.use_1200bps_touch" : "false" ,
339
- "upload.wait_for_upload_port" : "false" ,
340
- "vid.0" : "0x16D0" ,
341
- })
329
+ expWatterott := properties .NewMap ()
330
+ expWatterott .Set ("bootloader.extended_fuses" , "0xFE" )
331
+ expWatterott .Set ("bootloader.file" , "micronucleus-t841.hex" )
332
+ expWatterott .Set ("bootloader.high_fuses" , "0xDD" )
333
+ expWatterott .Set ("bootloader.lock_bits" , "0xFF" )
334
+ expWatterott .Set ("bootloader.low_fuses" , "0xE2" )
335
+ expWatterott .Set ("bootloader.tool" , "avrdude" )
336
+ expWatterott .Set ("bootloader.unlock_bits" , "0xFF" )
337
+ expWatterott .Set ("build.board" , "AVR_ATTINY841" )
338
+ expWatterott .Set ("build.core" , "tiny841" )
339
+ expWatterott .Set ("build.f_cpu" , "8000000L" )
340
+ expWatterott .Set ("build.mcu" , "attiny841" )
341
+ expWatterott .Set ("build.variant" , "tiny14" )
342
+ expWatterott .Set ("menu.core.arduino" , "Standard Arduino" )
343
+ expWatterott .Set ("menu.core.arduino.build.core" , "arduino:arduino" )
344
+ expWatterott .Set ("menu.core.arduino.build.variant" , "tiny14" )
345
+ expWatterott .Set ("menu.core.spencekonde" , "ATtiny841 (by Spence Konde)" )
346
+ expWatterott .Set ("menu.core.spencekonde.build.core" , "tiny841" )
347
+ expWatterott .Set ("menu.core.spencekonde.build.variant" , "tiny14" )
348
+ expWatterott .Set ("menu.info.info" , "Press Reset, when Uploading is shown." )
349
+ expWatterott .Set ("name" , "ATtiny841 (8 MHz)" )
350
+ expWatterott .Set ("pid.0" , "0x0753" )
351
+ expWatterott .Set ("upload.disable_flushing" , "false" )
352
+ expWatterott .Set ("upload.maximum_size" , "6500" )
353
+ expWatterott .Set ("upload.protocol" , "usb" )
354
+ expWatterott .Set ("upload.tool" , "micronucleus" )
355
+ expWatterott .Set ("upload.use_1200bps_touch" , "false" )
356
+ expWatterott .Set ("upload.wait_for_upload_port" , "false" )
357
+ expWatterott .Set ("vid.0" , "0x16D0" )
342
358
confWatterott , err := boardWatterottTiny841 .GeneratePropertiesForConfiguration ("core=spencekonde,info=info" )
343
359
require .NoError (t , err , "generating core=spencekonde,info=info configuration" )
344
360
require .EqualValues (t , expWatterott .AsMap (), confWatterott .AsMap (), "generating core=spencekonde,info=info configuration" )
0 commit comments