Skip to content

Commit

Permalink
SAM4L: Use 16Khz AST instead of prescaling down to 1Khz
Browse files Browse the repository at this point in the history
  • Loading branch information
alevy committed Mar 29, 2016
1 parent b05f7c5 commit 7e107e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/chips/sam4l/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use core::cell::Cell;
use core::intrinsics;
use nvic;
use hil::alarm::{Alarm, AlarmClient, Freq1Khz};
use hil::alarm::{Alarm, AlarmClient, Freq16Khz};
use hil::Controller;
use chip;
use pm::{self, PBDClock};
Expand Down Expand Up @@ -64,7 +64,7 @@ impl Controller for Ast {
pm::enable_clock(pm::Clock::PBD(PBDClock::AST));
}
self.select_clock(Clock::ClockOsc32);
self.set_prescalar(4); // 32Khz / (2^(4 + 1)) = 1Khz
self.set_prescalar(0); // 32Khz / (2^(0 + 1)) = 16Khz
self.enable_alarm_wake();
self.clear_alarm();

Expand Down Expand Up @@ -237,7 +237,7 @@ impl Ast {

impl Alarm for Ast {

type Frequency = Freq1Khz;
type Frequency = Freq16Khz;

fn now(&self) -> u32 {
unsafe {
Expand Down

0 comments on commit 7e107e7

Please sign in to comment.