Skip to content

Commit

Permalink
Modularised code
Browse files Browse the repository at this point in the history
  • Loading branch information
LimSean committed Dec 7, 2018
1 parent f634f4e commit d181339
Show file tree
Hide file tree
Showing 61 changed files with 5,206 additions and 4,539 deletions.
3 changes: 2 additions & 1 deletion Eternite.mojo
Original file line number Diff line number Diff line change
@@ -1,11 1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Eternite" board="Mojo V3" language="Lucid">
<project name="Eternite.rev02" board="Mojo V3" language="Lucid">
<files>
<src>timer.luc</src>
<src>buzzer.luc</src>
<src>Eternite_alufunctions.luc</src>
<src>right_wrong.luc</src>
<src top="true">mojo_top.luc</src>
<src>eternite_fsm.luc</src>
<src>blinker.luc</src>
<ucf>user_interface.ucf</ucf>
<ucf lib="true">mojo.ucf</ucf>
Expand Down
64 changes: 32 additions & 32 deletions constraint/user_interface.ucf
Original file line number Diff line number Diff line change
@@ -1,22 1,22 @@
#<===================Outputs===========================>

#User Input LEDs
NET "user_input_led<0>" LOC = P58 | IOSTANDARD = LVTTL;
NET "user_input_led<1>" LOC = P67 | IOSTANDARD = LVTTL;
NET "user_input_led<2>" LOC = P75 | IOSTANDARD = LVTTL;
NET "user_input_led<3>" LOC = P79 | IOSTANDARD = LVTTL;
NET "user_input_led<4>" LOC = P81 | IOSTANDARD = LVTTL;
NET "user_input_led<5>" LOC = P83 | IOSTANDARD = LVTTL;
NET "user_input_led<6>" LOC = P85 | IOSTANDARD = LVTTL;
NET "user_input_led<7>" LOC = P88 | IOSTANDARD = LVTTL;
NET "user_input_led<8>" LOC = P93 | IOSTANDARD = LVTTL;
NET "user_input_led<9>" LOC = P95 | IOSTANDARD = LVTTL;
NET "user_input_led<10>" LOC = P98 | IOSTANDARD = LVTTL;
NET "user_input_led<11>" LOC = P100 | IOSTANDARD = LVTTL;
NET "user_input_led<12>" LOC = P102 | IOSTANDARD = LVTTL;
NET "user_input_led<13>" LOC = P105| IOSTANDARD = LVTTL;
NET "user_input_led<14>" LOC = P112 | IOSTANDARD = LVTTL;
NET "user_input_led<15>" LOC = P115 | IOSTANDARD = LVTTL;
NET "user_input_led<0>" LOC = P115 | IOSTANDARD = LVTTL;
NET "user_input_led<1>" LOC = P112 | IOSTANDARD = LVTTL;
NET "user_input_led<2>" LOC = P105 | IOSTANDARD = LVTTL;
NET "user_input_led<3>" LOC = P102 | IOSTANDARD = LVTTL;
NET "user_input_led<4>" LOC = P98 | IOSTANDARD = LVTTL;
NET "user_input_led<5>" LOC = P100 | IOSTANDARD = LVTTL;
NET "user_input_led<6>" LOC = P95 | IOSTANDARD = LVTTL;
NET "user_input_led<7>" LOC = P93 | IOSTANDARD = LVTTL;
NET "user_input_led<8>" LOC = P88 | IOSTANDARD = LVTTL;
NET "user_input_led<9>" LOC = P85 | IOSTANDARD = LVTTL;
NET "user_input_led<10>" LOC = P83 | IOSTANDARD = LVTTL;
NET "user_input_led<11>" LOC = P81 | IOSTANDARD = LVTTL;
NET "user_input_led<12>" LOC = P79 | IOSTANDARD = LVTTL;
NET "user_input_led<13>" LOC = P75| IOSTANDARD = LVTTL;
NET "user_input_led<14>" LOC = P67 | IOSTANDARD = LVTTL;
NET "user_input_led<15>" LOC = P58 | IOSTANDARD = LVTTL;

#Game Difficulty LED x2
NET "ledD<0>" LOC = P26 | IOSTANDARD = LVTTL;
Expand Down Expand Up @@ -55,22 55,22 @@ NET "buzz" LOC = P5 | IOSTANDARD = LVTTL;
#!!PULLDOWN IS NEEDED TO PREVENT FLOATING INPUT

#user
NET "user_input<0>" LOC = P57 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<1>" LOC = P66 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<2>" LOC = P74 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<3>" LOC = P78 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<4>" LOC = P80 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<5>" LOC = P82 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<6>" LOC = P84 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<7>" LOC = P87 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<8>" LOC = P92 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<9>" LOC = P94 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<10>" LOC = P97 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<11>" LOC = P99 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<12>" LOC = P101 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<13>" LOC = P104 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<14>" LOC = P111 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<15>" LOC = P114 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<0>" LOC = P114 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<1>" LOC = P111 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<2>" LOC = P104 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<3>" LOC = P101 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<4>" LOC = P99 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<5>" LOC = P97 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<6>" LOC = P94 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<7>" LOC = P92 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<8>" LOC = P87 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<9>" LOC = P84 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<10>" LOC = P82 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<11>" LOC = P80 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<12>" LOC = P78 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<13>" LOC = P74 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<14>" LOC = P66 | IOSTANDARD = LVTTL | PULLDOWN;
NET "user_input<15>" LOC = P57 | IOSTANDARD = LVTTL | PULLDOWN;


#A/B Toggle Switch
Expand Down
12 changes: 7 additions & 5 deletions source/buzzer.luc
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 31,28 @@ module buzzer (
}

right_wrong.RIGHT:
if(freq.q[14] == 1){

buzz = 1;
/*if(freq.q[14] == 1){
buzz = 1;
}
}*/
if (timer.q[24] == 1){
timer.d = 0;
right_wrong.d = right_wrong.IDLE;
}


right_wrong.WRONG:
if(freq.q[18] == 1){
if(freq.q[15] == 1){
buzz = 1;
}
if (timer.q[26] == 1){
if (timer.q[25] == 1){
timer.d = 0;
right_wrong.d = right_wrong.IDLE;
}

right_wrong.TIMEOUT:
if(freq.q[18] == 1){
if(freq.q[15] == 1){
buzz = 1;
}
if (timer.q[26] == 1){
Expand Down
Loading

0 comments on commit d181339

Please sign in to comment.