1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-04-08 05:45:37 +00:00

Add calls to dis/enable potato uart IRQ

Signed-off-by: Michael Neuling <mikey@neuling.org>
This commit is contained in:
Michael Neuling
2020-04-23 14:28:08 +10:00
parent dc6b1df653
commit fc5f7506f8
2 changed files with 12 additions and 0 deletions

View 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())

View 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);