Remove CGo from machine module

It isn't necessary anymore but apparently the Go importer didn't
complain about an unused import.
Этот коммит содержится в:
Ayke van Laethem 2018-08-29 20:44:56 +02:00
родитель d4f5700625
коммит 7991243554
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E97FF5335DFDFDED

Просмотреть файл

@ -2,9 +2,6 @@
package machine package machine
// #include "../runtime/runtime_nrf.h"
import "C"
import ( import (
"device/nrf" "device/nrf"
) )
@ -26,7 +23,6 @@ const (
) )
func (p GPIO) Configure(config GPIOConfig) { func (p GPIO) Configure(config GPIOConfig) {
//C.gpio_cfg(C.uint(p.Pin), C.gpio_mode_t(config.Mode))
cfg := config.Mode | nrf.P0_PIN_CNF_PULL_Disabled | nrf.P0_PIN_CNF_DRIVE_S0S1 | nrf.P0_PIN_CNF_SENSE_Disabled cfg := config.Mode | nrf.P0_PIN_CNF_PULL_Disabled | nrf.P0_PIN_CNF_DRIVE_S0S1 | nrf.P0_PIN_CNF_SENSE_Disabled
if config.Mode == GPIO_INPUT { if config.Mode == GPIO_INPUT {
cfg |= nrf.P0_PIN_CNF_INPUT_Connect cfg |= nrf.P0_PIN_CNF_INPUT_Connect
@ -37,7 +33,6 @@ func (p GPIO) Configure(config GPIOConfig) {
} }
func (p GPIO) Set(high bool) { func (p GPIO) Set(high bool) {
//C.gpio_set(C.uint(p.Pin), C.bool(value))
// TODO: compiler limitation: both operands must be the same LLVM type // TODO: compiler limitation: both operands must be the same LLVM type
if high { if high {
nrf.P0.OUTSET = 1 << uint32(p.Pin) nrf.P0.OUTSET = 1 << uint32(p.Pin)