diff options
Diffstat (limited to 'src/runtime/runtime_stm32f7x2.go')
-rw-r--r-- | src/runtime/runtime_stm32f7x2.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/runtime/runtime_stm32f7x2.go b/src/runtime/runtime_stm32f7x2.go index 29fe173c2..7158d14f3 100644 --- a/src/runtime/runtime_stm32f7x2.go +++ b/src/runtime/runtime_stm32f7x2.go @@ -38,6 +38,18 @@ func putchar(c byte) { machine.Serial.WriteByte(c) } +func getchar() byte { + for machine.Serial.Buffered() == 0 { + Gosched() + } + v, _ := machine.Serial.ReadByte() + return v +} + +func buffered() int { + return machine.Serial.Buffered() +} + func initCLK() { // PWR_CLK_ENABLE stm32.RCC.APB1ENR.SetBits(stm32.RCC_APB1ENR_PWREN) |