Commit c65a61e414d028a4bc81fd3677f2b7a65e4d4c07
Exists in
master
Merge branch 'master' of github.com:Wollw/Discrete-Automata-Cells
Showing 1 changed file Side-by-side Diff
Firmware/main.c
View file @
c65a61e
... | ... | @@ -34,13 +34,14 @@ |
34 | 34 | P2REN = P2_NEIGHBORS; |
35 | 35 | |
36 | 36 | uint8_t my_state = 0; |
37 | + uint8_t clk = 0; | |
37 | 38 | for (;;) { |
38 | - uint8_t clk = P1IN & P1_CLOCK; | |
39 | - if (clk) { | |
40 | - while ((clk = P1IN & P1_CLOCK)); // wait for clock to fall | |
39 | + if ((clk = P1IN & P1_CLOCK)) { | |
41 | 40 | |
42 | 41 | uint8_t ln = live_neighbors_port(P1IN, P1_NEIGHBORS) |
43 | 42 | + live_neighbors_port(P2IN, P2_NEIGHBORS); |
43 | + | |
44 | + while ((clk = P1IN & P1_CLOCK)); // wait for clock to fall | |
44 | 45 | |
45 | 46 | // Conway's Game of Life rules |
46 | 47 | if (my_state) |