2022-11-12 16:22:55 +00:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
2022-11-13 17:21:03 +00:00
|
|
|
"th7/core/th7"
|
2022-11-12 16:22:55 +00:00
|
|
|
"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 {
|
2022-11-13 17:21:03 +00:00
|
|
|
return th7.NewTH7Adapter(pcb, cfg), nil
|
2022-11-12 16:22:55 +00:00
|
|
|
}
|
|
|
|
}
|