Compare commits

...

2 Commits

Author SHA1 Message Date
Astro f3831aba18 main: change IP address to 192.168.1.26 2019-08-29 22:40:14 +02:00
Astro 0eefebf3ed board: reset timers for clean initialization
raced into hardfaults without.
2019-08-29 22:39:08 +02:00
2 changed files with 23 additions and 2 deletions

View File

@ -105,13 +105,34 @@ pub fn init() {
.pmc7().bits(3)
});
// Timers
// Enable timers
sysctl.rcgctimer.write(|w| w
.r2().set_bit()
.r3().set_bit()
.r4().set_bit()
.r5().set_bit()
);
// Reset timers
sysctl.srtimer.write(|w| w
.r2().set_bit()
.r3().set_bit()
.r4().set_bit()
.r5().set_bit()
);
sysctl.srtimer.write(|w| w
.r2().clear_bit()
.r3().clear_bit()
.r4().clear_bit()
.r5().clear_bit()
);
fn timers_ready(sysctl: &tm4c129x::sysctl::RegisterBlock) -> bool {
let prtimer = sysctl.prtimer.read();
prtimer.r2().bit() &&
prtimer.r3().bit() &&
prtimer.r4().bit() &&
prtimer.r5().bit()
}
while !timers_ready(sysctl) {}
// Manual: 13.4.5 PWM Mode
macro_rules! setup_timer_pwm {

View File

@ -115,7 +115,7 @@ fn main() -> ! {
println!("programmed MAC address is invalid, using default");
hardware_addr = EthernetAddress([0x10, 0xE2, 0xD5, 0x00, 0x03, 0x00]);
}
let mut ip_addrs = [IpCidr::new(IpAddress::v4(192, 168, 69, 1), 24)];
let mut ip_addrs = [IpCidr::new(IpAddress::v4(192, 168, 1, 26), 24)];
println!("MAC {} IP {}", hardware_addr, ip_addrs[0]);
let mut neighbor_cache_storage = [None; 8];
let neighbor_cache = NeighborCache::new(&mut neighbor_cache_storage[..]);