Revision 235
trying to implement uart. not working
proj.c | ||
---|---|---|
29 | 29 |
|
30 | 30 |
#include "list.h" |
31 | 31 |
|
32 |
#ifdef DIOGO |
|
33 |
#include "uart_macros.h" |
|
34 |
#include "test7.h" |
|
35 |
#endif |
|
36 |
|
|
32 | 37 |
int main(int argc, char* argv[]) { |
33 | 38 |
|
34 | 39 |
lcf_set_language("EN-US"); |
35 | 40 |
|
36 |
//lcf_trace_calls("/home/lcom/labs/proj/trace.txt");
|
|
41 |
lcf_trace_calls("/home/lcom/labs/proj/trace.txt"); |
|
37 | 42 |
|
38 | 43 |
lcf_log_output("/home/lcom/labs/proj/output.txt"); |
39 | 44 |
|
... | ... | |
48 | 53 |
|
49 | 54 |
int r; |
50 | 55 |
|
56 |
#ifdef DIOGO |
|
57 |
uint8_t conf; |
|
58 |
if((r = util_sys_inb(0x3F8+3, &conf))) return 1; //printf("0x%02X\n", conf); |
|
59 |
conf = 0x19; //00011001 |
|
60 |
//printf("0x%02X\n", conf); |
|
61 |
if((r = sys_outb(0x3F8+3, conf))) return 1; |
|
62 |
if((r = util_sys_inb(0x3F8+3, &conf))) return 1; //printf("0x%02X\n", conf); |
|
63 |
#endif |
|
64 |
|
|
51 | 65 |
font_t *consolas = font_ctor("/home/lcom/labs/proj/media/font/Consolas/xpm2"); |
52 | 66 |
if(consolas == NULL){ printf("Failed to load consolas\n"); return 1; } |
53 | 67 |
|
... | ... | |
137 | 151 |
tickdelay(micros_to_ticks(1000000));*/ |
138 | 152 |
|
139 | 153 |
// RTC |
154 |
/* |
|
140 | 155 |
uint8_t date[4], time[3]; |
141 | 156 |
|
142 | 157 |
if (rtc_read_time(time)) return 1; |
... | ... | |
146 | 161 |
printf("Hour: %02d:%02d:%02d\n", time[2], time[1], time[0]); |
147 | 162 |
|
148 | 163 |
printf("Date: %d, %02d/%02d/%02d\n", date[0], date[1], date[2], date[3]); |
164 |
*/ |
|
165 |
//UART |
|
166 |
/* |
|
167 |
printf("got %d\n", ser_test_conf(COM1_ADDR)); |
|
168 |
printf("\n"); |
|
169 |
printf("got %d\n", ser_test_set(COM1_ADDR, 6, 1, 0, 9800)); |
|
170 |
tickdelay(micros_to_ticks(1000000)); |
|
171 |
printf("got %d\n", ser_test_conf(COM1_ADDR)); |
|
172 |
*/ |
|
173 |
|
|
174 |
|
|
149 | 175 |
#endif |
150 | 176 |
|
151 | 177 |
#ifdef TELMO |
Also available in: Unified diff