@@ -26,15 +26,15 @@ import (
2626 "github.com/rs/zerolog/log"
2727)
2828
29- //CalibrationData contains the parsed structs from the a2l as well as the byte data from the hex file
30- //that are parsed by ReadCalibration()
29+ // CalibrationData contains the parsed structs from the a2l as well as the byte data from the hex file
30+ // that are parsed by ReadCalibration()
3131type CalibrationData struct {
32- a2l a2l.A2L
33- hex map [uint32 ]byte
32+ A2l a2l.A2L
33+ Hex map [uint32 ]byte
3434}
3535
36- //ReadCalibration takes filepaths to the a2l file and the hex file,
37- //parses them in parallel and returns a CalibrationData struct
36+ // ReadCalibration takes filepaths to the a2l file and the hex file,
37+ // parses them in parallel and returns a CalibrationData struct
3838func ReadCalibration (a2lFilePath string , hexFilePath string ) (CalibrationData , error ) {
3939 var err error
4040 var cd CalibrationData
@@ -66,13 +66,13 @@ func ReadCalibration(a2lFilePath string, hexFilePath string) (CalibrationData, e
6666 }
6767 return cd , firstErr
6868 }
69- cd .a2l = <- a2lChan
70- cd .hex = <- hexChan
69+ cd .A2l = <- a2lChan
70+ cd .Hex = <- hexChan
7171 return cd , nil
7272}
7373
74- //readA2L is a helper function intended to be run in a separate go routine to call the a2l parser
75- //in order to be able to parse hex and a2l in parallel
74+ // readA2L is a helper function intended to be run in a separate go routine to call the a2l parser
75+ // in order to be able to parse hex and a2l in parallel
7676func readA2L (wg * sync.WaitGroup , ca chan a2l.A2L , ce chan error , a2lFilePath string ) {
7777 defer wg .Done ()
7878 a , err := a2l .ParseFromFile (a2lFilePath )
@@ -87,8 +87,8 @@ func readA2L(wg *sync.WaitGroup, ca chan a2l.A2L, ce chan error, a2lFilePath str
8787 }
8888}
8989
90- //readHex is a helper function intended to be run in a separate go routine to call the hex parser
91- //in order to be able to parse hex and a2l in parallel
90+ // readHex is a helper function intended to be run in a separate go routine to call the hex parser
91+ // in order to be able to parse hex and a2l in parallel
9292func readHex (wg * sync.WaitGroup , ch chan map [uint32 ]byte , ce chan error , hexFilePath string ) {
9393 defer wg .Done ()
9494 if strings .Contains (strings .ToLower (hexFilePath ), ".hex" ) {
@@ -122,7 +122,7 @@ func readHex(wg *sync.WaitGroup, ch chan map[uint32]byte, ce chan error, hexFile
122122
123123}
124124
125- //configureLogger adds a file logger, resets previous log file and does some formatting
125+ // configureLogger adds a file logger, resets previous log file and does some formatting
126126func configureLogger () error {
127127 var err error
128128 var file * os.File
@@ -149,7 +149,7 @@ func (cd *CalibrationData) getObjectsByIdent(ident string) []interface{} {
149149 var buf interface {}
150150 var exists bool
151151
152- for _ , m := range cd .a2l .Project .Modules {
152+ for _ , m := range cd .A2l .Project .Modules {
153153 buf , exists = m .AxisPts [ident ]
154154 if exists {
155155 calibrationObjects = append (calibrationObjects , buf )
0 commit comments