diff options
author | Max Christian Pohle | 2017-06-01 23:58:37 +0200 |
---|---|---|
committer | Max Christian Pohle | 2017-06-01 23:58:37 +0200 |
commit | e2b37ffacd2b3e76fd849fc046466568d5ac0779 (patch) | |
tree | 48782288862ce07b568b24c4a75de3a6446175c7 | |
parent | 9cbb0d04bba30988d6e814726800444fa020e845 (diff) | |
download | binwatch-mini-e2b37ffacd2b3e76fd849fc046466568d5ac0779.tar.bz2 binwatch-mini-e2b37ffacd2b3e76fd849fc046466568d5ac0779.zip |
Fixed PON pin to be LOW by default
-rw-r--r-- | main.c | 34 |
1 files changed, 16 insertions, 18 deletions
@@ -57,6 +57,7 @@ int main(void) | |||
57 | DDRB = 0b11111110; | 57 | DDRB = 0b11111110; |
58 | PORTB |= 1<<PB0; // activate pullup | 58 | PORTB |= 1<<PB0; // activate pullup |
59 | PORTB |= 1<<PB1; // activate receiver | 59 | PORTB |= 1<<PB1; // activate receiver |
60 | PORTB &= ~(1<<PB1); | ||
60 | 61 | ||
61 | // DDRB &= ~(1 << PB0); // makes PB0 an input pin (INT0) | 62 | // DDRB &= ~(1 << PB0); // makes PB0 an input pin (INT0) |
62 | // PORTB |= (1 << PB0); // activate input resistor | 63 | // PORTB |= (1 << PB0); // activate input resistor |
@@ -90,27 +91,24 @@ int main(void) | |||
90 | 91 | ||
91 | sei(); | 92 | sei(); |
92 | 93 | ||
94 | for(uint8_t i=0; i<16; i++) | ||
95 | { | ||
96 | print_data(3<<i); | ||
97 | _delay_ms(5); | ||
98 | } | ||
99 | |||
93 | while (1) | 100 | while (1) |
94 | { | 101 | { |
95 | //print_data(lastinterval<<1 | (PINB & PB0)); | 102 | //print_data(lastinterval<<1 | (PINB & PB0)); |
96 | // uint16_t data = 0; | 103 | |
97 | // for(int i=0; i<16; i++) | 104 | print_data( |
98 | // { | 105 | (uint16_t) 0 |
99 | // if(i<4) | 106 | | ((uint16_t) (PINB & 0x0001))<<15 |
100 | // data |= (t_current.s & (1<<i)); | 107 | | t_current.h<<8 |
101 | // else if(i <= 10) | 108 | | t_current.m |
102 | // data |= t_current.m & (1<<(i-4)); | 109 | ); |
103 | // else | 110 | // print_data(interval | ((PINB & PB0) == 1 ? 2 : 0)); |
104 | // data |= t_current.h & (1<<(i-11)); | 111 | //print_data(PINB); |
105 | // } | ||
106 | // print_data(data); | ||
107 | |||
108 | print_data( | ||
109 | (uint64_t) 0 | ||
110 | | t_current.h<<8 | ||
111 | | t_current.m); | ||
112 | //print_data(interval | ((PINB & PB0) == 1 ? 2 : 0)); | ||
113 | // print_data(PINB); | ||
114 | } | 112 | } |
115 | return 0; | 113 | return 0; |
116 | } | 114 | } |