Add calls to dis/enable potato uart IRQ
authorMichael Neuling <mikey@neuling.org>
Thu, 23 Apr 2020 04:28:08 +0000 (14:28 +1000)
committerMichael Neuling <mikey@neuling.org>
Thu, 23 Apr 2020 05:02:00 +0000 (15:02 +1000)
Signed-off-by: Michael Neuling <mikey@neuling.org>
hello_world/console.c
hello_world/console.h

index 8dca8cb7ed4badbe936f5ae304a62923fc0f109d..9abd6b9e325091bdada34fc8e9aa89606828d705 100644 (file)
@@ -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())
index fc64b9153f76e352618bb3b57c0055b691cab9b5..5cf303ad8acb63000e0f40b1614a237c6c8d1917 100644 (file)
@@ -1,6 +1,8 @@
 #include <stddef.h>
 
 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);