maixbit: init fpioa clock at reset
Этот коммит содержится в:
родитель
e1ceca1931
коммит
804dc8b1f9
3 изменённых файлов: 9 добавлений и 6 удалений
|
@ -44,10 +44,10 @@ var (
|
|||
|
||||
func (fpioa FPIOA) Init() {
|
||||
// Enable APB0 clock.
|
||||
kendryte.SYSCTL.CLK_EN_CENT.Set(kendryte.SYSCTL_CLK_EN_CENT_APB0_CLK_EN)
|
||||
kendryte.SYSCTL.CLK_EN_CENT.SetBits(kendryte.SYSCTL_CLK_EN_CENT_APB0_CLK_EN)
|
||||
|
||||
// Enable FPIOA peripheral.
|
||||
kendryte.SYSCTL.CLK_EN_PERI.Set(kendryte.SYSCTL_CLK_EN_PERI_FPIOA_CLK_EN)
|
||||
kendryte.SYSCTL.CLK_EN_PERI.SetBits(kendryte.SYSCTL_CLK_EN_PERI_FPIOA_CLK_EN)
|
||||
}
|
||||
|
||||
type UART struct {
|
||||
|
|
|
@ -2,13 +2,16 @@
|
|||
|
||||
package interrupt
|
||||
|
||||
import "device/kendryte"
|
||||
import (
|
||||
"device/kendryte"
|
||||
"device/riscv"
|
||||
)
|
||||
|
||||
// Enable enables this interrupt. Right after calling this function, the
|
||||
// interrupt may be invoked if it was already pending.
|
||||
func (irq Interrupt) Enable() {
|
||||
// TODO: Use current hartid
|
||||
kendryte.PLIC.TARGET_ENABLES[0].ENABLE[irq.num/32].SetBits(1 << (uint(irq.num) % 32))
|
||||
hartId := riscv.MHARTID.Get()
|
||||
kendryte.PLIC.TARGET_ENABLES[hartId].ENABLE[irq.num/32].SetBits(1 << (uint(irq.num) % 32))
|
||||
}
|
||||
|
||||
// SetPriority sets the interrupt priority for this interrupt. A higher priority
|
||||
|
|
|
@ -100,7 +100,7 @@ func handleInterrupt() {
|
|||
// initPeripherals configures periperhals the way the runtime expects them.
|
||||
func initPeripherals() {
|
||||
|
||||
//machine.FPIOA0.Init()
|
||||
machine.FPIOA0.Init()
|
||||
|
||||
machine.UART0.Configure(machine.UARTConfig{})
|
||||
}
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче