From fc5f7506f8b82afcc0d05e78e563f2ac84ea8d1b Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Thu, 23 Apr 2020 14:28:08 +1000 Subject: [PATCH] Add calls to dis/enable potato uart IRQ Signed-off-by: Michael Neuling --- hello_world/console.c | 10 ++++++++++ hello_world/console.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/hello_world/console.c b/hello_world/console.c index 8dca8cb..9abd6b9 100644 --- a/hello_world/console.c +++ b/hello_world/console.c @@ -91,6 +91,16 @@ void potato_uart_init(void) potato_uart_reg_write(POTATO_CONSOLE_CLOCK_DIV, potato_uart_divisor(PROC_FREQ, UART_FREQ)); } +void potato_uart_irq_en(void) +{ + potato_uart_reg_write(POTATO_CONSOLE_IRQ_EN, 0xff); +} + +void potato_uart_irq_dis(void) +{ + potato_uart_reg_write(POTATO_CONSOLE_IRQ_EN, 0x00); +} + int getchar(void) { while (potato_uart_rx_empty()) diff --git a/hello_world/console.h b/hello_world/console.h index fc64b91..5cf303a 100644 --- a/hello_world/console.h +++ b/hello_world/console.h @@ -1,6 +1,8 @@ #include void potato_uart_init(void); +void potato_uart_irq_en(void); +void potato_uart_irq_dis(void); int getchar(void); void putchar(unsigned char c); void putstr(const char *str, unsigned long len); -- 2.30.2