machine: do not expose RESET_MAGIC_VALUE
This is a constant for internal use only, but was (unintentionally?) exported. In addition, it doesn't follow the Go naming convention. This change simply renames the constant so that it is unexported.
Этот коммит содержится в:
родитель
2409bbef69
коммит
107b1c2906
24 изменённых файлов: 24 добавлений и 24 удалений
|
@ -7,7 +7,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0x07738135
|
const resetMagicValue = 0x07738135
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0x07738135
|
const resetMagicValue = 0x07738135
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0x07738135
|
const resetMagicValue = 0x07738135
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0x07738135
|
const resetMagicValue = 0x07738135
|
||||||
|
|
||||||
// GPIO Pins - Digital Low
|
// GPIO Pins - Digital Low
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Definition for compatibility, but not used
|
// Definition for compatibility, but not used
|
||||||
const RESET_MAGIC_VALUE = 0x00000000
|
const resetMagicValue = 0x00000000
|
||||||
|
|
||||||
const (
|
const (
|
||||||
LED = PC18
|
LED = PC18
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -245,7 +245,7 @@ const (
|
||||||
|
|
||||||
// Other peripheral constants
|
// Other peripheral constants
|
||||||
const (
|
const (
|
||||||
RESET_MAGIC_VALUE = 0xF01669EF // Used to reset into bootloader
|
resetMagicValue = 0xF01669EF // Used to reset into bootloader
|
||||||
)
|
)
|
||||||
|
|
||||||
// USB CDC pins
|
// USB CDC pins
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xF01669EF
|
const resetMagicValue = 0xF01669EF
|
||||||
|
|
||||||
// Digital pins
|
// Digital pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0x07738135
|
const resetMagicValue = 0x07738135
|
||||||
|
|
||||||
// Note: On the P1AM-100, pins D8, D9, D10, A3, and A4 are used for
|
// Note: On the P1AM-100, pins D8, D9, D10, A3, and A4 are used for
|
||||||
// communication with the base controller.
|
// communication with the base controller.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ADC0 = A0
|
ADC0 = A0
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
// used to reset into bootloader
|
// used to reset into bootloader
|
||||||
const RESET_MAGIC_VALUE = 0xf01669ef
|
const resetMagicValue = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -1735,7 +1735,7 @@ func EnterBootloader() {
|
||||||
|
|
||||||
// Perform magic reset into bootloader, as mentioned in
|
// Perform magic reset into bootloader, as mentioned in
|
||||||
// https://github.com/arduino/ArduinoCore-samd/issues/197
|
// https://github.com/arduino/ArduinoCore-samd/issues/197
|
||||||
*(*uint32)(unsafe.Pointer(uintptr(0x20007FFC))) = RESET_MAGIC_VALUE
|
*(*uint32)(unsafe.Pointer(uintptr(0x20007FFC))) = resetMagicValue
|
||||||
|
|
||||||
arm.SystemReset()
|
arm.SystemReset()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1975,7 +1975,7 @@ func EnterBootloader() {
|
||||||
|
|
||||||
// Perform magic reset into bootloader, as mentioned in
|
// Perform magic reset into bootloader, as mentioned in
|
||||||
// https://github.com/arduino/ArduinoCore-samd/issues/197
|
// https://github.com/arduino/ArduinoCore-samd/issues/197
|
||||||
*(*uint32)(unsafe.Pointer(uintptr(0x20000000 + HSRAM_SIZE - 4))) = RESET_MAGIC_VALUE
|
*(*uint32)(unsafe.Pointer(uintptr(0x20000000 + HSRAM_SIZE - 4))) = resetMagicValue
|
||||||
|
|
||||||
arm.SystemReset()
|
arm.SystemReset()
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче