Skip to content

Commit

Permalink
Fixed waiting
Browse files Browse the repository at this point in the history
  • Loading branch information
kwagyeman committed Apr 4, 2017
1 parent 4d72e1b commit 13dad4e
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 17 deletions.
4 changes: 2 additions & 2 deletions module/V2-Application/qt.pri
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
!isEmpty(QT_PRI_INCLUDED):error("qt.pri already included")
QT_PRI_INCLUDED = 1

OPENMVSWD_VERSION = 1.3.0
OPENMVSWD_COMPAT_VERSION = 1.3.0
OPENMVSWD_VERSION = 1.5.0
OPENMVSWD_COMPAT_VERSION = 1.5.0

# enable c++11
CONFIG += c++11
Expand Down
Binary file modified module/V2-Application/share/firmware/OPENMV2/bootloader.elf
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV2/firmware.bin
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV2/firmware.dfu
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV2/firmware.elf
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV2/openmv.bin
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV2/openmv.dfu
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV3/bootloader.elf
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV3/firmware.bin
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV3/firmware.dfu
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV3/firmware.elf
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV3/openmv.bin
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/OPENMV3/openmv.dfu
Binary file not shown.
Binary file modified module/V2-Application/share/firmware/TOP.binary
Binary file not shown.
2 changes: 1 addition & 1 deletion module/V2-Application/share/firmware/firmware.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.0
2.3.0
Binary file modified module/V2/bin/TOP.binary
Binary file not shown.
Binary file modified module/V2/bin/TOP.eeprom
Binary file not shown.
22 changes: 15 additions & 7 deletions module/V2/src/TOP.spin
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub main | i, x, r
command_state := constant(0 + 1)
outa[swd_sel_pin[0]] := 1
outa[swd_pwr_pin[0]] := 0
waitcnt((clkfreq << 1) + cnt)
debounce_reset_wait
com.writeString(string("ROW0 On", com#Carriage_Return, com#Line_Feed))
quit

Expand All @@ -127,7 +127,7 @@ pub main | i, x, r
command_state := constant(1 + 1)
outa[swd_sel_pin[1]] := 1
outa[swd_pwr_pin[1]] := 0
waitcnt((clkfreq << 1) + cnt)
debounce_reset_wait
com.writeString(string("ROW1 On", com#Carriage_Return, com#Line_Feed))
quit

Expand All @@ -137,7 +137,7 @@ pub main | i, x, r
command_state := constant(2 + 1)
outa[swd_sel_pin[2]] := 1
outa[swd_pwr_pin[2]] := 0
waitcnt((clkfreq << 1) + cnt)
debounce_reset_wait
com.writeString(string("ROW2 On", com#Carriage_Return, com#Line_Feed))
quit

Expand All @@ -147,12 +147,12 @@ pub main | i, x, r
command_state := constant(3 + 1)
outa[swd_sel_pin[3]] := 1
outa[swd_pwr_pin[3]] := 0
waitcnt((clkfreq << 1) + cnt)
debounce_reset_wait
com.writeString(string("ROW3 On", com#Carriage_Return, com#Line_Feed))
quit

$53_57_44_39: ' Ping
com.writeString(string("Hello World - v2.2.0", com#Carriage_Return, com#Line_Feed))
com.writeString(string("Hello World - v2.3.0", com#Carriage_Return, com#Line_Feed))
quit

repeat i from 0 to constant(NUM_SWD - 1)
Expand Down Expand Up @@ -204,7 +204,7 @@ pri kill_port | x
x := command_state - 1
outa[swd_sel_pin[x]] := 0
outa[swd_pwr_pin[x]] := 1
waitcnt((clkfreq << 1) + cnt)
debounce_reset_wait
com.writeString(string("ROW"))
com.writeString(DECOut(x))
com.writeString(string(" Off", com#Carriage_Return, com#Line_Feed))
Expand All @@ -231,6 +231,14 @@ pri heart_beat | i
com.writeString(DECOut(i))
com.writeString(string(" [Testing] 0%", com#Carriage_Return, com#Line_Feed))

pri debounce_reset_wait | i, tmp

tmp := cnt

repeat until (cnt - tmp) > (clkfreq >> 1)
repeat i from 0 to constant(NUM_SWD - 1)
debounce_reset(i)

pri debounce_reset(port)

if (cnt - debounce_cnt[port]) > (clkfreq / 1000)
Expand Down Expand Up @@ -514,4 +522,4 @@ PRI HEXIn(stringPointer) ' String to integer.
quit

result += constant(($A - ("A" & $F)) -> 4)
result := ((result <- 4) + (byte[stringPointer++] & $F))
result := ((result <- 4) + (byte[stringPointer++] & $F))
22 changes: 15 additions & 7 deletions module/V2/src/TOP_2.spin
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub main | i, x, r
command_state := constant(0 + 1)
outa[swd_sel_pin[0]] := 1
outa[swd_pwr_pin[0]] := 0
waitcnt((clkfreq << 1) + cnt)
debounce_reset_wait
com.writeString(string("ROW0 On", com#Carriage_Return, com#Line_Feed))
quit

Expand All @@ -127,7 +127,7 @@ pub main | i, x, r
command_state := constant(1 + 1)
outa[swd_sel_pin[1]] := 1
outa[swd_pwr_pin[1]] := 0
waitcnt((clkfreq << 1) + cnt)
debounce_reset_wait
com.writeString(string("ROW1 On", com#Carriage_Return, com#Line_Feed))
quit

Expand All @@ -137,7 +137,7 @@ pub main | i, x, r
command_state := constant(2 + 1)
outa[swd_sel_pin[2]] := 1
outa[swd_pwr_pin[2]] := 0
waitcnt((clkfreq << 1) + cnt)
debounce_reset_wait
com.writeString(string("ROW2 On", com#Carriage_Return, com#Line_Feed))
quit

Expand All @@ -147,12 +147,12 @@ pub main | i, x, r
command_state := constant(3 + 1)
outa[swd_sel_pin[3]] := 1
outa[swd_pwr_pin[3]] := 0
waitcnt((clkfreq << 1) + cnt)
debounce_reset_wait
com.writeString(string("ROW3 On", com#Carriage_Return, com#Line_Feed))
quit

$53_57_44_39: ' Ping
com.writeString(string("Hello World - v2.2.0", com#Carriage_Return, com#Line_Feed))
com.writeString(string("Hello World - v2.3.0", com#Carriage_Return, com#Line_Feed))
quit

repeat i from 0 to constant(NUM_SWD - 1)
Expand Down Expand Up @@ -204,7 +204,7 @@ pri kill_port | x
x := command_state - 1
outa[swd_sel_pin[x]] := 0
outa[swd_pwr_pin[x]] := 1
waitcnt((clkfreq << 1) + cnt)
debounce_reset_wait
com.writeString(string("ROW"))
com.writeString(DECOut(x))
com.writeString(string(" Off", com#Carriage_Return, com#Line_Feed))
Expand All @@ -231,6 +231,14 @@ pri heart_beat | i
com.writeString(DECOut(i))
com.writeString(string(" [Testing] 0%", com#Carriage_Return, com#Line_Feed))

pri debounce_reset_wait | i, tmp

tmp := cnt

repeat until (cnt - tmp) > (clkfreq >> 1)
repeat i from 0 to constant(NUM_SWD - 1)
debounce_reset(i)

pri debounce_reset(port)

if (cnt - debounce_cnt[port]) > (clkfreq / 1000)
Expand Down Expand Up @@ -514,4 +522,4 @@ PRI HEXIn(stringPointer) ' String to integer.
quit

result += constant(($A - ("A" & $F)) -> 4)
result := ((result <- 4) + (byte[stringPointer++] & $F))
result := ((result <- 4) + (byte[stringPointer++] & $F))

0 comments on commit 13dad4e

Please sign in to comment.