Skip to content

Commit

Permalink
adopt Chips verified code changes, clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
ironsheep committed Jan 27, 2021
1 parent 4415479 commit cbb5087
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 28 deletions.
16 changes: 8 additions & 8 deletions Src/isp_hub75_demoMorphSeg.spin2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'' File....... isp_hub75_demoMorphSeg.spin2
'' Purpose.... Top-level Demonstration - showing off our HUB75 matrix w/Morphing 7 segment displays
'' Authors.... Stephen M Moraco
'' -- Copyright (c) 2020 Iron Sheep Productions, LLC
'' -- Copyright (c) 2021 Iron Sheep Productions, LLC
'' -- see below for terms of use
'' E-mail..... stephen@ironsheep.biz
'' Started.... Jan 2021
Expand Down Expand Up @@ -153,21 +153,21 @@ PRI loopUntilCountersFinish() | ctrIndex
quit
'}

PUB wait100thSecs(count)
'' Wait for {count} 100ths of a second
PRI wait100thSecs(count)
' Wait for {count} 100ths of a second
if count > 0
repeat count
waitms(10) ' 1/100 seconds

PUB waitSecs(count)
'' Wait for {count} 100ths of a second
PRI waitSecs(count)
' Wait for {count} 100ths of a second
if count > 0
repeat count
waitms(1000) ' 1 seconds


PUB stop()
'' Stop the driver
PRI stop()
' Stop the driver
if cog
display.stop()
cog := 0
Expand All @@ -180,7 +180,7 @@ CON { license }
-------------------------------------------------------------------------------------------------
MIT License

Copyright (c) 2020 Iron Sheep Productions, LLC
Copyright (c) 2021 Iron Sheep Productions, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
25 changes: 13 additions & 12 deletions Src/isp_hub75_morph7seg.spin2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'' File....... isp_hub75_morph7seg.spin2
'' Purpose.... manipulate a morphing 7 segment digit
'' Authors.... Stephen M Moraco
'' -- Copyright (c) 2020 Iron Sheep Productions, LLC
'' -- Copyright (c) 2021 Iron Sheep Productions, LLC
'' -- see below for terms of use
'' E-mail..... stephen@ironsheep.biz
'' Started.... Jan 2021
Expand Down Expand Up @@ -111,9 +111,9 @@ PRI ensureIsSetup()
' Do intial setup, if not yet done
if not isSetup
initialSetup()
leftPtrsActual := @@leftPtrs
'leftPtrsActual := @@leftPtrs
'leftPtrsAddr := @leftPtrs
objectOffset := (leftPtrsActual - leftPtrsAddr) - 40 ' why this 40????
'objectOffset := (leftPtrsActual - leftPtrsAddr) - 40 ' why this 40????


PRI initialSetup() | byte segIndex, orientation, segRow, segCol, segW, segL
Expand Down Expand Up @@ -178,7 +178,7 @@ PRI turnOnDigit(digit) | byte fromSegments, byte toSegments, bitIndex
'else
' going from digit to same digit, nothing to do!

PRI reconfigureForDigit(digitValue) | tblIndex, pLtTable, pRtTable, actionIndex, segmentIndex, byte nextAction
PRI reconfigureForDigit(digitValue) | tblIndex, pLtTable, pRtTable, pLtTable2, pRtTable2, actionIndex, segmentIndex, byte nextAction
if currValue <> digitValue
if digitValue <> DIGIT_HIDDEN
if currValue < 0
Expand All @@ -187,12 +187,13 @@ PRI reconfigureForDigit(digitValue) | tblIndex, pLtTable, pRtTable, actionIndex,
'debug("m7:reconfig ", udec_(currValue), " -> ", udec_(digitValue))
'pLtTable := LONG[@leftPtrs][currValue] + objectOffset
pLtTable := @@leftPtrs[currValue]

'debug(" - ", uhex_long(pLtTable))
'debug("m7: ltLookup: ", uhex_long(pLtTable), uhex_long(pLtTable2))
'debug("m7: ltLookup ", uhex_long(pLtTable))
'pRtTable := LONG [pLtTable][digitValue] + objectOffset
pRtTable := @@pLtTable[digitValue]
pRtTable := @@LONG[pLtTable][digitValue]
' remember to review @@ in P1 manual
'debug(" - ", uhex_long(pRtTable))
'debug("m7: rtLookup: ", uhex_long(pRtTable), uhex_long(pRtTable2))
'debug("m7: rtLookup ", uhex_long(pRtTable))
'repeat
if pRtTable <> NO_ACTIONS
actionIndex := 0
Expand Down Expand Up @@ -229,9 +230,9 @@ segmentsByDigit
byte %0111_1011 ' 9 abcd-fg

' NEW TABLE of Actions:
leftPtrsActual long 0
leftPtrsAddr long @leftPtrs
objectOffset long 0
'leftPtrsActual long 0
'leftPtrsAddr long @leftPtrs
'objectOffset long 0

' NOTE from spin2 doc pg4 symbol standing alone inherits last declared type!!
' =======================================================================================================================
Expand Down Expand Up @@ -1504,7 +1505,7 @@ CON { license }
-------------------------------------------------------------------------------------------------
MIT License

Copyright (c) 2020 Iron Sheep Productions, LLC
Copyright (c) 2021 Iron Sheep Productions, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 5 additions & 4 deletions Src/isp_hub75_morphCounters.spin2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'' File....... isp_hub75_morphCounters.spin2
'' Purpose.... Manage groups of morphing 7-segment digits
'' Authors.... Stephen M Moraco
'' -- Copyright (c) 2020 Iron Sheep Productions, LLC
'' -- Copyright (c) 2021 Iron Sheep Productions, LLC
'' -- see below for terms of use
'' E-mail..... stephen@ironsheep.biz
'' Started.... Jan 2021
Expand Down Expand Up @@ -71,7 +71,7 @@ PUB null()
'' This is NOT a top level object

PUB initialize()
'' init the opbject so it knows nothing but knows it knows nothing ;-)
'' init this opbject so it knows nothing but knows it knows nothing ;-)
isSetup := FALSE
groupType := GRP_UNKNOWN

Expand Down Expand Up @@ -155,6 +155,7 @@ PUB isConfigured() : bStatus
bStatus := (groupType <> GRP_UNKNOWN)

PUB nextTimeCycle() | bShowCurrValue
'' step this counter by one
'debug("mG:-nxTimCyc(", udec_(groupType), ")")
bShowCurrValue := TRUE
case groupType
Expand Down Expand Up @@ -212,7 +213,7 @@ PRI updateDigitsFromValue(desiredValue) | currDivisor, digitIdx, digitValue, rem
'repeat ' stop to eval debug

PUB isAnimationComplete() : completeStatus | digitIdx
'' return T/F where T means this counter animations are complete
'' return T/F where T means this countera animations are complete
'debug("mG:-cmplt? (", udec_(groupType), ")")
completeStatus := TRUE
repeat digitIdx from 0 to MAX_DIGITS - 1
Expand Down Expand Up @@ -268,7 +269,7 @@ CON { license }
-------------------------------------------------------------------------------------------------
MIT License

Copyright (c) 2020 Iron Sheep Productions, LLC
Copyright (c) 2021 Iron Sheep Productions, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions Src/isp_hub75_morphSegment.spin2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'' File....... isp_hub75_morphSegment.spin2
'' Purpose.... manipulate a single morphing segment
'' Authors.... Stephen M Moraco
'' -- Copyright (c) 2020 Iron Sheep Productions, LLC
'' -- Copyright (c) 2021 Iron Sheep Productions, LLC
'' -- see below for terms of use
'' E-mail..... stephen@ironsheep.biz
'' Started.... Jan 2021
Expand Down Expand Up @@ -87,10 +87,10 @@ PUB null()
'' This is NOT a top level object

PUB placeSegment(row, column, orientation, segmentWidth, segmentLength, initialState, rgbColor) | nmInitState, nmSeg, bIsHoriz
'' Locate a desired segment on our screen. Draw initial segement if state is NOT off
nmInitState := nameOfState(initialState)
nmSeg := nameOfSegment(orientation)
'debug("mSG:placeSegment rc=(", udec_(row), ",", udec_(column), "), ", zstr_(nmSeg), ", wl=(", udec_(segmentWidth) , ", ", udec_(segmentLength), "), ", zstr_(nmInitState), ", RGB=", uhex_long_(rgbColor))
'' Locate a desired segment on our screen. Draw initial segement if state is NOT off
' record settings choices we are given extrapolating some
currentState := desiredEndState := nextState := STATE_OFF
segStartX := 0 #> column <# screen.MAX_PHYSICAL_COLUMNS - 1
Expand Down Expand Up @@ -128,7 +128,7 @@ PUB placeSegment(row, column, orientation, segmentWidth, segmentLength, initialS
updateSegmentToState(initialState)

PUB commandSegment(commandBits) | bTurnOn, nmStyle, nmSeg, nmOnOff
'' Start the segment moving to _OFF if not already off and NOT busy
'' Start the segment moving if NOT busy
bTurnOn := (commandBits & MASK_ONOFF) == CMD_TURN_ON
animateStyle := (commandBits & MASK_STYLE)
nmStyle := nameOfCommand(animateStyle)
Expand Down Expand Up @@ -543,7 +543,7 @@ CON { license }
-------------------------------------------------------------------------------------------------
MIT License

Copyright (c) 2020 Iron Sheep Productions, LLC
Copyright (c) 2021 Iron Sheep Productions, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit cbb5087

Please sign in to comment.