17 lines
269 B
Go
17 lines
269 B
Go
package core
|
|
|
|
import (
|
|
"th7/core/th7"
|
|
"th7/data/config"
|
|
"th7/ports"
|
|
)
|
|
|
|
func NewAdapter(pcb ports.PCBPort, cfg config.Config) (ports.CorePort, error) {
|
|
|
|
if cfg.Board.Debug {
|
|
return NewDummyAdapter(pcb), nil
|
|
} else {
|
|
return th7.NewTH7Adapter(pcb, cfg), nil
|
|
}
|
|
}
|