mirror of
https://github.com/tjboldt/Apple2-IO-RPi.git
synced 2024-05-29 00:41:45 +00:00
More lint fixes
This commit is contained in:
parent
0e3e12dcd8
commit
ad14d9919c
|
@ -17,14 +17,14 @@ import (
|
|||
"github.com/tjboldt/Apple2-IO-RPi/RaspberryPi/apple2driver/handlers"
|
||||
)
|
||||
|
||||
const ReadBlockCommand = 1
|
||||
const WriteBlockCommand = 2
|
||||
const GetTimeCommand = 3
|
||||
const ChangeDriveCommand = 4
|
||||
const ExecCommand = 5
|
||||
const LoadFileCommand = 6
|
||||
const SaveFileCommand = 7
|
||||
const MenuCommand = 8
|
||||
const readBlockCommand = 1
|
||||
const writeBlockCommand = 2
|
||||
const getTimeCommand = 3
|
||||
const changeDriveCommand = 4
|
||||
const execCommand = 5
|
||||
const loadFileCommand = 6
|
||||
const saveFileCommand = 7
|
||||
const menuCommand = 8
|
||||
|
||||
func main() {
|
||||
drive1, drive2 := getDriveFiles()
|
||||
|
@ -40,17 +40,17 @@ func main() {
|
|||
command, err := comm.ReadByte()
|
||||
if err == nil {
|
||||
switch command {
|
||||
case ReadBlockCommand:
|
||||
case readBlockCommand:
|
||||
handlers.ReadBlockCommand(drive1, drive2)
|
||||
case WriteBlockCommand:
|
||||
case writeBlockCommand:
|
||||
handlers.WriteBlockCommand(drive1, drive2)
|
||||
case GetTimeCommand:
|
||||
case getTimeCommand:
|
||||
handlers.GetTimeCommand()
|
||||
case ExecCommand:
|
||||
case execCommand:
|
||||
handlers.ExecCommand()
|
||||
case LoadFileCommand:
|
||||
case loadFileCommand:
|
||||
handlers.LoadFileCommand()
|
||||
case MenuCommand:
|
||||
case menuCommand:
|
||||
handlers.MenuCommand()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
// This file is used for handling ProDOS image block reading and writing
|
||||
|
||||
package handlers
|
||||
|
||||
import (
|
||||
|
@ -14,6 +15,7 @@ import (
|
|||
|
||||
var oldFirmware = false
|
||||
|
||||
// ReadBlockCommand handles requests to read ProDOS blocks
|
||||
func ReadBlockCommand(drive1 *os.File, drive2 *os.File) {
|
||||
blockLow, _ := comm.ReadByte()
|
||||
blockHigh, _ := comm.ReadByte()
|
||||
|
@ -50,6 +52,7 @@ func ReadBlockCommand(drive1 *os.File, drive2 *os.File) {
|
|||
}
|
||||
}
|
||||
|
||||
// WriteBlockCommand handles requests to write ProDOS blocks
|
||||
func WriteBlockCommand(drive1 *os.File, drive2 *os.File) {
|
||||
blockLow, _ := comm.ReadByte()
|
||||
blockHigh, _ := comm.ReadByte()
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
// This file is used for setting up the communications for the handlers
|
||||
|
||||
package handlers
|
||||
|
||||
import (
|
||||
|
@ -11,6 +12,7 @@ import (
|
|||
|
||||
var comm a2io.A2Io
|
||||
|
||||
// SetCommunication configures whether to use real or mock communications
|
||||
func SetCommunication(commIO a2io.A2Io) {
|
||||
comm = commIO
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
// This file is contains the handler for retrieving the ProDOS timestamp
|
||||
// based on the current time
|
||||
|
||||
package handlers
|
||||
|
||||
import (
|
||||
|
@ -13,6 +14,7 @@ import (
|
|||
"github.com/tjboldt/ProDOS-Utilities/prodos"
|
||||
)
|
||||
|
||||
// GetTimeCommand handles the request to get ProDOS time bytes
|
||||
func GetTimeCommand() {
|
||||
fmt.Printf("Sending date/time...\n")
|
||||
prodosTime := prodos.DateTimeToProDOS(time.Now())
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
// This file is contains the handler for loading files directly from the
|
||||
// Raspberry Pi onto the Apple II
|
||||
|
||||
package handlers
|
||||
|
||||
import (
|
||||
|
@ -11,6 +12,7 @@ import (
|
|||
"os"
|
||||
)
|
||||
|
||||
// LoadFileCommand handles requests to direct read files from Linux to the Apple II
|
||||
func LoadFileCommand() {
|
||||
fileName, _ := comm.ReadString()
|
||||
|
||||
|
|
|
@ -4,12 +4,14 @@
|
|||
|
||||
// This file is contains the handler for displaying the menu of choices on
|
||||
// the Apple II
|
||||
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// MenuCommand handles the request to show menu options on the Apple II
|
||||
func MenuCommand() {
|
||||
fmt.Printf("Sending menu...\n")
|
||||
comm.WriteString("Apple2-IO-RPi\r" +
|
||||
|
|
Loading…
Reference in New Issue
Block a user