aboutsummaryrefslogtreecommitdiff
path: root/software/main.c
diff options
context:
space:
mode:
authorMax Christian Pohle2017-06-18 18:11:54 +0200
committerMax Christian Pohle2017-06-18 18:11:54 +0200
commit73eb23b36f020d15cbeff06fd16f90cb818bf4da (patch)
tree42a2e81b48061d509a06ddbbe696e9245287b0c6 /software/main.c
parentd2fdbf06caa21ec4f0c95e270408cdf83ea6e9da (diff)
downloadbinwatch-mini-master.tar.bz2
binwatch-mini-master.zip
DCF indicator in the middle between h and mHEADmaster
Diffstat (limited to 'software/main.c')
-rw-r--r--software/main.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/software/main.c b/software/main.c
index b791647..2b7322e 100644
--- a/software/main.c
+++ b/software/main.c
@@ -19,7 +19,7 @@ static inline void BIT_CLEAR(volatile uint8_t* target, uint8_t bit) { *target &=
19 19
20 20
21/* 21/*
22 * 22 *
23 * PB2 : connected to ShiftClock on Port 11 23 * PB2 : connected to ShiftClock on Port 11
24 * PB3 : connected to MemoryClock on Port 12 (shows content of memory) 24 * PB3 : connected to MemoryClock on Port 12 (shows content of memory)
25 * PB4 (PIN3) : connected to SERIAL_IN on pin 14 25 * PB4 (PIN3) : connected to SERIAL_IN on pin 14
@@ -108,37 +108,33 @@ int main(void)
108 } 108 }
109 109
110 110
111 char lastsec = 0; 111 t_current.m = 0xffff;
112 t_current.h = 0xffff;
113
112 while (1) 114 while (1)
113 { 115 {
114 //print_data(lastinterval<<1 | (PINB & PB0)); 116 //print_data(lastinterval<<1 | (PINB & PB0));
115 if(lastsec != t_current.s) 117
118 /*
119 if(t_current.s & 0x1) // uneven number?
116 { 120 {
117 //for (uint8_t i = 16; i > 0; i--) 121 print_data((uint16_t) 31<<6);
118 // { 122 _delay_us(50);
119 print_data(
120 ~(
121 (uint16_t) 0
122 // | ((uint16_t) (PINB & 0x0001))<<15
123 | t_current.h<<10
124 | t_current.m<<5
125 | t_current.s>>1)
126 );
127 _delay_us(50);
128 // }
129 lastsec = t_current.s;
130 } 123 }
124 */
125
131 126
132 print_data( 127 print_data(
133 (uint16_t) 0 128 (uint16_t) 0
134 // | ((uint16_t) (PINB & 0x0001))<<15 129 | ((uint16_t) (PINB & 0x0001) ? 0x3<<7 : 0<<7)
135 | t_current.h<<10 130 | ((t_current.h & 0x1F)<<10)
136 | t_current.m<<5 131 | ((t_current.m & 0x3F)<<0)
137 | t_current.s>>1
138 ); 132 );
133
139 sleep_cpu(); 134 sleep_cpu();
140 135
141 136
137
142 // print_data(interval | ((PINB & PB0) == 1 ? 2 : 0)); 138 // print_data(interval | ((PINB & PB0) == 1 ? 2 : 0));
143 //print_data(PINB); 139 //print_data(PINB);
144 } 140 }
..