Skip to content

Commit c1e1feb

Browse files
committed
Use 0.7.0 PAC and fix PWM
1 parent 82fd75b commit c1e1feb

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ edition = "2018"
2323
[dependencies]
2424
cortex-m = "0.5.8"
2525
nb = "0.1.1"
26-
stm32l4 = "0.6.0"
26+
stm32l4 = "0.7.0"
2727
as-slice = "0.1"
2828

2929
[dependencies.cast]

src/pwm.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,15 @@ macro_rules! hal {
192192
}
193193

194194
fn get_duty(&self) -> Self::Duty {
195-
unsafe { (*$TIMX::ptr()).ccr1.read().ccr1().bits() }
195+
unsafe { (*$TIMX::ptr()).ccr1.read().ccr().bits() }
196196
}
197197

198198
fn get_max_duty(&self) -> Self::Duty {
199199
unsafe { (*$TIMX::ptr()).arr.read().arr().bits() }
200200
}
201201

202202
fn set_duty(&mut self, duty: Self::Duty) {
203-
unsafe { (*$TIMX::ptr()).ccr1.write(|w| w.ccr1().bits(duty)) }
203+
unsafe { (*$TIMX::ptr()).ccr1.write(|w| w.ccr().bits(duty)) }
204204
}
205205
}
206206

@@ -216,15 +216,15 @@ macro_rules! hal {
216216
}
217217

218218
fn get_duty(&self) -> Self::Duty {
219-
unsafe { (*$TIMX::ptr()).ccr2.read().ccr2().bits() }
219+
unsafe { (*$TIMX::ptr()).ccr2.read().ccr().bits() }
220220
}
221221

222222
fn get_max_duty(&self) -> Self::Duty {
223223
unsafe { (*$TIMX::ptr()).arr.read().arr().bits() }
224224
}
225225

226226
fn set_duty(&mut self, duty: Self::Duty) {
227-
unsafe { (*$TIMX::ptr()).ccr2.write(|w| w.ccr2().bits(duty)) }
227+
unsafe { (*$TIMX::ptr()).ccr2.write(|w| w.ccr().bits(duty)) }
228228
}
229229
}
230230

@@ -240,15 +240,15 @@ macro_rules! hal {
240240
}
241241

242242
fn get_duty(&self) -> Self::Duty {
243-
unsafe { (*$TIMX::ptr()).ccr3.read().ccr3().bits() }
243+
unsafe { (*$TIMX::ptr()).ccr3.read().ccr().bits() }
244244
}
245245

246246
fn get_max_duty(&self) -> Self::Duty {
247247
unsafe { (*$TIMX::ptr()).arr.read().arr().bits() }
248248
}
249249

250250
fn set_duty(&mut self, duty: Self::Duty) {
251-
unsafe { (*$TIMX::ptr()).ccr3.write(|w| w.ccr3().bits(duty)) }
251+
unsafe { (*$TIMX::ptr()).ccr3.write(|w| w.ccr().bits(duty)) }
252252
}
253253
}
254254

@@ -264,15 +264,15 @@ macro_rules! hal {
264264
}
265265

266266
fn get_duty(&self) -> Self::Duty {
267-
unsafe { (*$TIMX::ptr()).ccr4.read().ccr4().bits() }
267+
unsafe { (*$TIMX::ptr()).ccr4.read().ccr().bits() }
268268
}
269269

270270
fn get_max_duty(&self) -> Self::Duty {
271271
unsafe { (*$TIMX::ptr()).arr.read().arr().bits() }
272272
}
273273

274274
fn set_duty(&mut self, duty: Self::Duty) {
275-
unsafe { (*$TIMX::ptr()).ccr4.write(|w| w.ccr4().bits(duty)) }
275+
unsafe { (*$TIMX::ptr()).ccr4.write(|w| w.ccr().bits(duty)) }
276276
}
277277
}
278278
)+

0 commit comments

Comments
 (0)