Skip to content

Commit

Permalink
Add restriction on TOFF and TBL values combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
wilriker committed Aug 6, 2018
1 parent 094549e commit 365a499
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
chopconf
6 changes: 5 additions & 1 deletion chopconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"flag"
"fmt"
"log"

"strconv"
)
Expand Down Expand Up @@ -91,7 +92,10 @@ func main() {
flag.Parse()

if hendVal+hstrtVal > 15 {
panic("hstrt + hend must be <= 15")
log.Fatal("hstrt + hend must be <= 15")
}
if toffVal == 1 && tblVal == 16 {
log.Fatal("TOFF=1 must not be combined with TBL=16")
}

chopregister := uint32(tbl(tblVal) | chm(chmVal) | rndtf(rndtfVal) | hdec(hdecVal) | hend(hendVal) | hstrt(hstrtVal) | toff(toffVal))
Expand Down

0 comments on commit 365a499

Please sign in to comment.