@@ -227,12 +227,12 @@ pub fn write_timers(mcu: &Mcu, w: &mut dyn Write) -> Result<(), io::Error> {
227
227
writeln ! ( w, " type ControlB = {};" , find_reg_suffix( "TCCR" , "B" ) . name) ?;
228
228
writeln ! ( w, " type InterruptMask = {};" , find_reg( "TIMSK" ) . name) ?;
229
229
writeln ! ( w, " type InterruptFlag = {};" , find_reg( "TIFR" ) . name) ?;
230
- writeln ! ( w, " const CS0: RegisterBits<Self::ControlB> = Self::ControlB::CS00;" ) ?;
231
- writeln ! ( w, " const CS1: RegisterBits<Self::ControlB> = Self::ControlB::CS01;" ) ?;
232
- writeln ! ( w, " const CS2: RegisterBits<Self::ControlB> = Self::ControlB::CS02;" ) ?;
233
- writeln ! ( w, " const WGM0: RegisterBits<Self::ControlA> = Self::ControlA::WGM00;" ) ?;
234
- writeln ! ( w, " const WGM1: RegisterBits<Self::ControlA> = Self::ControlA::WGM01;" ) ?;
235
- writeln ! ( w, " const WGM2: RegisterBits<Self::ControlB> = Self::ControlB::WGM020;" ) ?;
230
+ writeln ! ( w, " const CS0: RegisterBits<Self::ControlB> = Self::ControlB::CS{}0;" , timer_number ) ?;
231
+ writeln ! ( w, " const CS1: RegisterBits<Self::ControlB> = Self::ControlB::CS{}1;" , timer_number ) ?;
232
+ writeln ! ( w, " const CS2: RegisterBits<Self::ControlB> = Self::ControlB::CS{}2;" , timer_number ) ?;
233
+ writeln ! ( w, " const WGM0: RegisterBits<Self::ControlA> = Self::ControlA::WGM{}0;" , timer_number ) ?;
234
+ writeln ! ( w, " const WGM1: RegisterBits<Self::ControlA> = Self::ControlA::WGM{}1;" , timer_number ) ?;
235
+ writeln ! ( w, " const WGM2: RegisterBits<Self::ControlB> = Self::ControlB::WGM{}20;" , timer_number ) ?;
236
236
writeln ! ( w, " const OCIEA: RegisterBits<Self::InterruptMask> = Self::InterruptMask::OCIE{}A;" , timer_number) ?;
237
237
writeln ! ( w, "}}" ) ?;
238
238
}
@@ -264,13 +264,13 @@ pub fn write_timers(mcu: &Mcu, w: &mut dyn Write) -> Result<(), io::Error> {
264
264
writeln ! ( w, " type ControlC = {};" , find_reg_suffix( "TCCR" , "C" ) . name) ?;
265
265
writeln ! ( w, " type InterruptMask = {};" , find_reg( "TIMSK" ) . name) ?;
266
266
writeln ! ( w, " type InterruptFlag = {};" , find_reg( "TIFR" ) . name) ?;
267
- writeln ! ( w, " const CS0: RegisterBits<Self::ControlB> = Self::ControlB::CS10;" ) ?;
268
- writeln ! ( w, " const CS1: RegisterBits<Self::ControlB> = Self::ControlB::CS11;" ) ?;
269
- writeln ! ( w, " const CS2: RegisterBits<Self::ControlB> = Self::ControlB::CS12;" ) ?;
270
- writeln ! ( w, " const WGM0: RegisterBits<Self::ControlA> = Self::ControlA::WGM10;" ) ?;
271
- writeln ! ( w, " const WGM1: RegisterBits<Self::ControlA> = Self::ControlA::WGM11;" ) ?;
272
- writeln ! ( w, " const WGM2: RegisterBits<Self::ControlB> = Self::ControlB::WGM10;" ) ?;
273
- writeln ! ( w, " const WGM3: RegisterBits<Self::ControlB> = Self::ControlB::WGM11;" ) ?;
267
+ writeln ! ( w, " const CS0: RegisterBits<Self::ControlB> = Self::ControlB::CS{}0;" , timer_number ) ?;
268
+ writeln ! ( w, " const CS1: RegisterBits<Self::ControlB> = Self::ControlB::CS{}1;" , timer_number ) ?;
269
+ writeln ! ( w, " const CS2: RegisterBits<Self::ControlB> = Self::ControlB::CS{}2;" , timer_number ) ?;
270
+ writeln ! ( w, " const WGM0: RegisterBits<Self::ControlA> = Self::ControlA::WGM{}0;" , timer_number ) ?;
271
+ writeln ! ( w, " const WGM1: RegisterBits<Self::ControlA> = Self::ControlA::WGM{}1;" , timer_number ) ?;
272
+ writeln ! ( w, " const WGM2: RegisterBits<Self::ControlB> = Self::ControlB::WGM{}0;" , timer_number ) ?;
273
+ writeln ! ( w, " const WGM3: RegisterBits<Self::ControlB> = Self::ControlB::WGM{}1;" , timer_number ) ?;
274
274
writeln ! ( w, " const OCIEA: RegisterBits<Self::InterruptMask> = Self::InterruptMask::OCIE{}A;" , timer_number) ?;
275
275
writeln ! ( w, "}}" ) ?;
276
276
}
0 commit comments