File tree 3 files changed +29
-0
lines changed
3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,14 @@ impl Avrdude {
95
95
command = command. arg ( "-b" ) . arg ( baudrate. to_string ( ) ) ;
96
96
}
97
97
98
+ for option in options. extra_options . iter ( ) . flatten ( ) {
99
+ command = command. arg ( "-U" ) . arg ( option)
100
+ }
101
+
102
+ if let Some ( touch_rate) = options. touch_baudrate {
103
+ command = command. arg ( "-r" ) . arg ( touch_rate. to_string ( ) ) ;
104
+ }
105
+
98
106
// TODO: Check that `bin` does not contain :
99
107
let mut flash_instruction: std:: ffi:: OsString = "flash:w:" . into ( ) ;
100
108
flash_instruction. push ( bin) ;
Original file line number Diff line number Diff line change 48
48
[nano-new .usb-info ]
49
49
error = " Not able to guess port"
50
50
51
+ [nano-every ]
52
+ name = " Arduino Every"
53
+
54
+ [nano-every .reset ]
55
+ automatic = true
56
+
57
+ [nano-every .avrdude ]
58
+ programmer = " jtag2updi"
59
+ partno = " atmega4809"
60
+ baudrate = 115200
61
+ do-chip-erase = true
62
+ extra-options = [" fuse2:w:0x01:m" , " fuse5:w:0xC9:m" , " fuse8:w:0x00:m" ]
63
+ touch-baudrate = 1200
64
+
65
+ [nano-every .usb-info ]
66
+ port-ids = [{ vid = 0x2341 , pid = 0x0058 }]
67
+
51
68
[leonardo ]
52
69
name = " Arduino Leonardo"
53
70
Original file line number Diff line number Diff line change @@ -131,6 +131,8 @@ pub struct BoardAvrdudeOptions {
131
131
// Option<if baudrate == -1 { None } else { NonZeroU32(baudrate) }>
132
132
pub baudrate : Option < Option < NonZeroU32 > > ,
133
133
pub do_chip_erase : Option < bool > ,
134
+ pub extra_options : Option < Vec < String > > ,
135
+ pub touch_baudrate : Option < u32 > ,
134
136
}
135
137
impl BoardAvrdudeOptions {
136
138
pub fn merge ( self , base : Self ) -> Self {
@@ -139,6 +141,8 @@ impl BoardAvrdudeOptions {
139
141
partno : self . partno . or ( base. partno ) ,
140
142
baudrate : self . baudrate . or ( base. baudrate ) ,
141
143
do_chip_erase : self . do_chip_erase . or ( base. do_chip_erase ) ,
144
+ extra_options : self . extra_options . or ( base. extra_options ) ,
145
+ touch_baudrate : self . touch_baudrate . or ( base. touch_baudrate ) ,
142
146
}
143
147
}
144
148
}
You can’t perform that action at this time.
0 commit comments