Add sample puts function
"Hello, world!" :)
This commit is contained in:
14
sw/main.c
14
sw/main.c
@@ -1,10 +1,24 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "sevenseg.h"
|
#include "sevenseg.h"
|
||||||
|
#include "uart.h"
|
||||||
|
|
||||||
|
void puts(const char* s)
|
||||||
|
{
|
||||||
|
while (*s) {
|
||||||
|
uart_txb_block(*s);
|
||||||
|
if (*s == '\n')
|
||||||
|
uart_txb_block('\r');
|
||||||
|
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
hex_enable(0x3f);
|
hex_enable(0x3f);
|
||||||
hex_set_24(0xabcdef);
|
hex_set_24(0xabcdef);
|
||||||
|
|
||||||
|
puts("Hello, World!\n");
|
||||||
while(1);
|
while(1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user