maixbit (uart): working on data tx

When the data to send is too long the program gives an exception.
This commit is contained in:
Yannis Huber
2020-06-16 00:05:32 +02:00
committed by Ron Evans
parent 7814964693
commit d599959711
8 changed files with 417 additions and 26 deletions
+19
View File
@@ -0,0 +1,19 @@
// +build k210
package interrupt
import "device/kendryte"
// 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))
}
// SetPriority sets the interrupt priority for this interrupt. A higher priority
// number means a higher priority (unlike Cortex-M). Priority 0 effectively
// disables the interrupt.
func (irq Interrupt) SetPriority(priority uint8) {
kendryte.PLIC.PRIORITY[irq.num].Set(uint32(priority))
}