cmd/treatment: remove build tags for treatment

This was done because I don't know why this wouldn't build on circleci with the standard pi audio command in pi.go.

cmd/treatment: merge pi.go into main.go

There's no need for two files

Approved-by: Alan Noble
This commit is contained in:
Trek Hopton 2024-04-17 07:17:57 +00:00
parent 2dd2c464c6
commit 9f56bee095
3 changed files with 14 additions and 83 deletions

View File

@ -1,34 +0,0 @@
// +build !pi3
/*
DESCRIPTION
circleci.go defines a dummy initialisation command for running on circleci.
AUTHORS
Ella Pietraroia <ella@ausocean.org>
Scott Barnard <scott@ausocean.org>
LICENSE
Copyright (C) 2020 the Australian Ocean Lab (AusOcean)
It is free software: you can redistribute it and/or modify them
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
It is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
in gpl.txt. If not, see http://www.gnu.org/licenses.
*/
package main
import "bitbucket.org/ausocean/utils/logging"
const audioCmd = ""
func initCommand(log logging.Logger) {}

View File

@ -92,6 +92,10 @@ var varMap = map[string]string{
"AudioFilePath": "string", "AudioFilePath": "string",
} }
const audioCmd = "aplay"
func initCommand(l logging.Logger) { checkPath(audioCmd, l) }
func main() { func main() {
mts.Meta = meta.NewWith([][2]string{{metaPreambleKey, metaPreambleData}}) mts.Meta = meta.NewWith([][2]string{{metaPreambleKey, metaPreambleData}})
@ -274,7 +278,6 @@ func setChannels(mode string, l logging.Logger) error {
return fmt.Errorf("channel set command failed: %s", &errBuff) return fmt.Errorf("channel set command failed: %s", &errBuff)
} }
l.Info("mode set to", "mode", mode) l.Info("mode set to", "mode", mode)
return nil return nil
} }

View File

@ -1,38 +0,0 @@
// +build pi3
/*
DESCRIPTION
pi3.go defines an initialisation function for use when running on the
Raspberry Pi 3.
AUTHORS
Ella Pietraroia <ella@ausocean.org>
Scott Barnard <scott@ausocean.org>
Saxon Nelson-Milton <saxon@ausocean.org>
LICENSE
Copyright (C) 2020 the Australian Ocean Lab (AusOcean)
It is free software: you can redistribute it and/or modify them
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
It is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
in gpl.txt. If not, see http://www.gnu.org/licenses.
*/
package main
import (
"bitbucket.org/ausocean/utils/logging"
)
const audioCmd = "aplay"
func initCommand(l logging.Logger) { checkPath(audioCmd, l) }