mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
Run Nick G's spellchecker github.com/client9/misspell, carefuly fix what it found (#4235)
This commit is contained in:
+2
-2
@@ -76,7 +76,7 @@ func (b *channelBlockedList) remove(old *channelBlockedList) *channelBlockedList
|
||||
return b
|
||||
}
|
||||
|
||||
// detatch removes all other channel operations that are part of the same select statement.
|
||||
// detach removes all other channel operations that are part of the same select statement.
|
||||
// If the input is not part of a select statement, this is a no-op.
|
||||
// This must be called before resuming any task blocked on a channel operation in order to ensure that it is not placed on the runqueue twice.
|
||||
func (b *channelBlockedList) detach() {
|
||||
@@ -88,7 +88,7 @@ func (b *channelBlockedList) detach() {
|
||||
// cancel all other channel operations that are part of this select statement
|
||||
switch {
|
||||
case &b.allSelectOps[i] == b:
|
||||
// This entry is the one that was already detatched.
|
||||
// This entry is the one that was already detached.
|
||||
continue
|
||||
case v.t == nil:
|
||||
// This entry is not used (nil channel).
|
||||
|
||||
@@ -410,7 +410,7 @@ func GC() {
|
||||
runGC()
|
||||
}
|
||||
|
||||
// runGC performs a garbage colleciton cycle. It is the internal implementation
|
||||
// runGC performs a garbage collection cycle. It is the internal implementation
|
||||
// of the runtime.GC() function. The difference is that it returns the number of
|
||||
// free bytes in the heap after the GC is finished.
|
||||
func runGC() (freeBytes uintptr) {
|
||||
@@ -424,7 +424,7 @@ func runGC() (freeBytes uintptr) {
|
||||
|
||||
if baremetal && hasScheduler {
|
||||
// Channel operations in interrupts may move task pointers around while we are marking.
|
||||
// Therefore we need to scan the runqueue seperately.
|
||||
// Therefore we need to scan the runqueue separately.
|
||||
var markedTaskQueue task.Queue
|
||||
runqueueScan:
|
||||
for !runqueue.Empty() {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// however use a bit more RAM to store the layout of each object.
|
||||
//
|
||||
// The pointer/non-pointer information for objects is stored in the first word
|
||||
// of the object. It is described below but in essense it contains a bitstring
|
||||
// of the object. It is described below but in essence it contains a bitstring
|
||||
// of a particular size. This size does not indicate the size of the object:
|
||||
// instead the allocated object is a multiple of the bitstring size. This is so
|
||||
// that arrays and slices can store the size of the object efficiently. The
|
||||
|
||||
@@ -26,7 +26,7 @@ func New(id int, handler func(Interrupt)) Interrupt
|
||||
// and use that in an Interrupt object. That way the compiler will be able to
|
||||
// optimize away all interrupt handles that are never used in a program.
|
||||
// This system only works when interrupts need to be enabled before use and this
|
||||
// is done only through calling Enable() on this object. If interrups cannot
|
||||
// is done only through calling Enable() on this object. If interrupts cannot
|
||||
// individually be enabled/disabled, the compiler should create a pseudo-call
|
||||
// (like runtime/interrupt.use()) that keeps the interrupt alive.
|
||||
type handle struct {
|
||||
|
||||
@@ -169,7 +169,7 @@ func handleInterrupt() {
|
||||
// save MSTATUS & MEPC, which could be overwritten by another CPU interrupt
|
||||
mstatus := riscv.MSTATUS.Get()
|
||||
mepc := riscv.MEPC.Get()
|
||||
// Useing threshold to temporary disable this interrupts.
|
||||
// Using threshold to temporary disable this interrupts.
|
||||
// FYI: using CPU interrupt enable bit make runtime to loose interrupts.
|
||||
reg := (*volatile.Register32)(unsafe.Add(unsafe.Pointer(&esp.INTERRUPT_CORE0.CPU_INT_PRI_0), interruptNumber*4))
|
||||
thresholdSave := reg.Get()
|
||||
|
||||
@@ -107,7 +107,7 @@ func findGlobals(found func(start, end uintptr)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Move on to the next load command (wich may or may not be a
|
||||
// Move on to the next load command (which may or may not be a
|
||||
// LC_SEGMENT_64).
|
||||
cmd = (*segmentLoadCommand)(unsafe.Add(unsafe.Pointer(cmd), cmd.cmdsize))
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ func readRTC() uint32 {
|
||||
|
||||
// ticks are in microseconds
|
||||
// Returns true if the timer completed.
|
||||
// Returns false if another interrupt occured which requires an early return to scheduler.
|
||||
// Returns false if another interrupt occurred which requires an early return to scheduler.
|
||||
func timerSleep(ticks uint32) bool {
|
||||
timerWakeup.Set(0)
|
||||
if ticks < 7 {
|
||||
|
||||
@@ -307,7 +307,7 @@ func readRTC() uint32 {
|
||||
|
||||
// ticks are in microseconds
|
||||
// Returns true if the timer completed.
|
||||
// Returns false if another interrupt occured which requires an early return to scheduler.
|
||||
// Returns false if another interrupt occurred which requires an early return to scheduler.
|
||||
func timerSleep(ticks uint32) bool {
|
||||
timerWakeup.Set(0)
|
||||
if ticks < 8 {
|
||||
|
||||
@@ -115,7 +115,7 @@ func sleepTicks(d timeUnit) {
|
||||
// Sleep until the next interrupt happens.
|
||||
avr.Asm("sei\nsleep\ncli")
|
||||
if cmpMatch.Get() != 0 {
|
||||
// The CMP interrupt occured, so we have slept long enough.
|
||||
// The CMP interrupt occurred, so we have slept long enough.
|
||||
cmpMatch.Set(0)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
// This function is called at HardFault.
|
||||
// Before this function is called, the stack pointer is reset to the initial
|
||||
// stack pointer (loaded from addres 0x0) and the previous stack pointer is
|
||||
// stack pointer (loaded from address 0x0) and the previous stack pointer is
|
||||
// passed as an argument to this function. This allows for easy inspection of
|
||||
// the stack the moment a HardFault occurs, but it means that the stack will be
|
||||
// corrupted by this function and thus this handler must not attempt to recover.
|
||||
|
||||
@@ -85,7 +85,7 @@ func handleInterrupt() {
|
||||
riscv.MCAUSE.Set(0)
|
||||
}
|
||||
|
||||
// initPeripherals configures periperhals the way the runtime expects them.
|
||||
// initPeripherals configures peripherals the way the runtime expects them.
|
||||
func initPeripherals() {
|
||||
// Configure PLL to output 320MHz.
|
||||
// R=2: divide 16MHz to 8MHz
|
||||
|
||||
@@ -105,7 +105,7 @@ func handleInterrupt() {
|
||||
riscv.MCAUSE.Set(0)
|
||||
}
|
||||
|
||||
// initPeripherals configures periperhals the way the runtime expects them.
|
||||
// initPeripherals configures peripherals the way the runtime expects them.
|
||||
func initPeripherals() {
|
||||
// Enable APB0 clock.
|
||||
kendryte.SYSCTL.CLK_EN_CENT.SetBits(kendryte.SYSCTL_CLK_EN_CENT_APB0_CLK_EN)
|
||||
|
||||
Reference in New Issue
Block a user