Revision 287
implemented final, working version of uart and protocol
interrupts_func.c | ||
---|---|---|
4 | 4 |
#include "timer.h" |
5 | 5 |
#include "keyboard.h" |
6 | 6 |
#include "mouse.h" |
7 |
#include "uart.h"
|
|
7 |
#include "hltp.h"
|
|
8 | 8 |
#include "utils.h" |
9 | 9 |
#include "errors.h" |
10 | 10 |
|
... | ... | |
50 | 50 |
NULL, |
51 | 51 |
}; |
52 | 52 |
|
53 |
static void process_received(const uint8_t *p, const size_t sz){ |
|
54 |
void *q = NULL; |
|
55 |
hltp_type t = hltp_interpret(p, sz, &q); |
|
56 |
switch(t){ |
|
57 |
case hltp_type_string:{ |
|
58 |
char *s = q; |
|
59 |
printf("%s\n", s); |
|
60 |
} break; |
|
61 |
default: break; |
|
62 |
} |
|
63 |
} |
|
64 |
|
|
53 | 65 |
int (subscribe_all)(void) { |
54 | 66 |
|
55 | 67 |
/// Timer interrupt handling |
... | ... | |
111 | 123 |
return SBCR_ERROR; |
112 | 124 |
} |
113 | 125 |
uart_subscribed = 1; |
114 |
nctp_init(); |
|
126 |
nctp_init(process_received);
|
|
115 | 127 |
|
116 | 128 |
return SUCCESS; |
117 | 129 |
} |
Also available in: Unified diff