comparison main.c @ 325:b05c9fd7c098

Merge
author Matt Johnston <matt@ucc.asn.au>
date Tue, 22 May 2012 21:32:52 +0800
parents 5181ea55ea77 e3664732f11f
children 878be5e353a0
comparison
equal deleted inserted replaced
323:5181ea55ea77 325:b05c9fd7c098
106 CLKPR = _BV(CLKPCE); 106 CLKPR = _BV(CLKPCE);
107 // divide by 4 107 // divide by 4
108 CLKPR = _BV(CLKPS1); 108 CLKPR = _BV(CLKPS1);
109 sei(); 109 sei();
110 110
111 // 3.3v power for bluetooth and SD
111 DDR_LED |= _BV(PIN_LED); 112 DDR_LED |= _BV(PIN_LED);
112 DDR_SHDN |= _BV(PIN_SHDN); 113 DDR_SHDN |= _BV(PIN_SHDN);
114
115 // INT0 setup
116 EIMSK = _BV(INT0);
117 // set pullup
118 PORTD |= _BV(PD2);
113 } 119 }
114 120
115 static void 121 static void
116 set_aux_power(uint8_t on) 122 set_aux_power(uint8_t on)
117 { 123 {
440 { 446 {
441 printf_P(PSTR("Bad command\n")); 447 printf_P(PSTR("Bad command\n"));
442 } 448 }
443 } 449 }
444 450
451 ISR(INT0_vwct)
452 {
453 need_comms = 1;
454 }
455
456
445 ISR(USART_RX_vect) 457 ISR(USART_RX_vect)
446 { 458 {
447 char c = UDR0; 459 char c = UDR0;
448 uart_putchar(c, NULL); 460 uart_putchar(c, NULL);
449 if (c == '\r') 461 if (c == '\r')