Mercurial > templog
comparison main.c @ 89:51d889ad39a3
main.c : add a delay before turning on uart
server : try and improve timeouts, get rid of lightblue, don't use https,
use python logging module
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 15 Jul 2012 21:49:59 +0800 |
parents | 81b8c84344c4 |
children | a1c1c2d475b0 |
comparison
equal
deleted
inserted
replaced
88:6f4497a448e8 | 89:51d889ad39a3 |
---|---|
236 } | 236 } |
237 | 237 |
238 static void | 238 static void |
239 uart_off() | 239 uart_off() |
240 { | 240 { |
241 // Turn of interrupts and disable tx/rx | 241 // Turn off interrupts and disable tx/rx |
242 UCSR0B = 0; | 242 UCSR0B = 0; |
243 uart_enabled = 0; | 243 uart_enabled = 0; |
244 | 244 |
245 // Power reduction register | 245 // Power reduction register |
246 PRR |= _BV(PRUSART0); | 246 PRR |= _BV(PRUSART0); |
677 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) | 677 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) |
678 { | 678 { |
679 last_comms_clock = clock_epoch; | 679 last_comms_clock = clock_epoch; |
680 } | 680 } |
681 set_aux_power(1); | 681 set_aux_power(1); |
682 // avoid receiving rubbish, perhaps | |
683 _delay_ms(50); | |
682 uart_on(); | 684 uart_on(); |
683 | 685 |
684 // write sd card here? same 3.3v regulator... | 686 // write sd card here? same 3.3v regulator... |
685 | 687 |
686 for (comms_timeout = wake_secs; | 688 for (comms_timeout = wake_secs; |