Revision 328
increased bitrate to 115200
proj/libs/classes/include/list.h | ||
---|---|---|
1 | 1 |
#ifndef LIST_H_INCLUDED |
2 | 2 |
#define LIST_H_INCLUDED |
3 | 3 |
|
4 |
struct list_node; |
|
5 | 4 |
/** |
6 |
* @brief List node. |
|
5 |
* @defgroup list_t list_t |
|
6 |
* @brief List module |
|
7 | 7 |
* |
8 |
* Can be used like a C++ std::list. |
|
9 |
* A list_t is a sequence of list_node_t nodes, that store void* to allow for more flexibility. |
|
10 |
* |
|
11 |
* @{ |
|
12 |
*/ |
|
13 |
|
|
14 |
/** |
|
15 |
* @defgroup list_node_t list_node_t |
|
16 |
* @ingroup list |
|
17 |
* @brief List node module |
|
18 |
* |
|
8 | 19 |
* Can be used like a C++ std::list iterator. |
9 | 20 |
* A list node stores a void* to allow for more flexibility. |
21 |
* |
|
22 |
* @{ |
|
10 | 23 |
*/ |
24 |
|
|
25 |
struct list_node; |
|
11 | 26 |
typedef struct list_node list_node_t; |
12 | 27 |
|
13 | 28 |
/** |
... | ... | |
42 | 57 |
*/ |
43 | 58 |
void** (list_node_val )(list_node_t *p); |
44 | 59 |
|
45 |
struct list; |
|
46 | 60 |
/** |
47 |
* @brief List. |
|
48 |
* |
|
49 |
* Can be used like a C++ std::list. |
|
50 |
* A list_t is a sequence of list_node_t nodes, that store void* to allow for more flexibility. |
|
61 |
* @} |
|
51 | 62 |
*/ |
63 |
|
|
64 |
struct list; |
|
65 |
|
|
52 | 66 |
typedef struct list list_t; |
53 | 67 |
|
54 | 68 |
/** |
... | ... | |
131 | 145 |
*/ |
132 | 146 |
list_node_t* (list_find) (list_t *l, void *val); |
133 | 147 |
|
148 |
/** |
|
149 |
* @} |
|
150 |
*/ |
|
151 |
|
|
134 | 152 |
#endif //LIST_H_INCLUDED |
proj/libs/classes/include/queue.h | ||
---|---|---|
1 | 1 |
#ifndef QUEUE_H_INCLUDED |
2 | 2 |
#define QUEUE_H_INCLUDED |
3 | 3 |
|
4 |
struct queue; |
|
5 | 4 |
/** |
6 |
* @brief Queue. |
|
5 |
* @defgroup queue_t queue_t |
|
6 |
* @brief Queue module |
|
7 | 7 |
* |
8 | 8 |
* Can be used like a C++ std::queue. |
9 | 9 |
* A queue_t is an interface for a list_t that simulates a FIFO. |
10 |
* |
|
11 |
* @{ |
|
10 | 12 |
*/ |
13 |
|
|
14 |
|
|
15 |
struct queue; |
|
11 | 16 |
typedef struct queue queue_t; |
12 | 17 |
|
13 | 18 |
/** |
... | ... | |
54 | 59 |
*/ |
55 | 60 |
void (queue_pop )(queue_t *q); |
56 | 61 |
|
62 |
/** |
|
63 |
* @} |
|
64 |
*/ |
|
65 |
|
|
57 | 66 |
#endif //QUEUE_H_INCLUDED |
proj/libs/kbc/src/mouse.c | ||
---|---|---|
158 | 158 |
if((ret = util_sys_inb(OUTPUT_BUF, byte))) return ret; |
159 | 159 |
else return SUCCESS; |
160 | 160 |
} |
161 |
tickdelay(micros_to_ticks(DELAY));
|
|
161 |
tickdelay(micros_to_ticks(period));
|
|
162 | 162 |
} |
163 | 163 |
} |
164 | 164 |
|
proj/libs/uart/include/uart.h | ||
---|---|---|
42 | 42 |
int uart_set_bits_per_character(int base_addr, uint8_t bits_per_char); |
43 | 43 |
int uart_set_stop_bits (int base_addr, uint8_t stop ); |
44 | 44 |
int uart_set_parity (int base_addr, uart_parity par ); |
45 |
int uart_set_bit_rate (int base_addr, double bit_rate );
|
|
45 |
int uart_set_bit_rate (int base_addr, uint32_t bit_rate );
|
|
46 | 46 |
|
47 | 47 |
int uart_enable_int_rx (int base_addr); |
48 | 48 |
int uart_disable_int_rx(int base_addr); |
proj/libs/uart/src/uart.c | ||
---|---|---|
213 | 213 |
conf = (conf & (~UART_PARITY)) | parity; |
214 | 214 |
return uart_set_lcr(base_addr, conf); |
215 | 215 |
} |
216 |
int uart_set_bit_rate(int base_addr, double bit_rate){
|
|
216 |
int uart_set_bit_rate(int base_addr, uint32_t bit_rate){
|
|
217 | 217 |
int ret = SUCCESS; |
218 | 218 |
uint16_t latch = (uint16_t)(UART_BITRATE/bit_rate); |
219 | 219 |
uint8_t dll = UART_GET_DLL(latch); |
proj/src/ent.c | ||
---|---|---|
284 | 284 |
free(p->visited); |
285 | 285 |
free(p); |
286 | 286 |
} |
287 |
static int16_t (map_get_x_screen)(const map_t *p){ return (int16_t)((-x_origin)*scale); } |
|
288 |
static int16_t (map_get_y_screen)(const map_t *p){ return (int16_t)((-y_origin)*scale); } |
|
287 |
static int16_t (map_get_x_screen)(const map_t *p){ (void)p; return (int16_t)((-x_origin)*scale); }
|
|
288 |
static int16_t (map_get_y_screen)(const map_t *p){ (void)p; return (int16_t)((-y_origin)*scale); }
|
|
289 | 289 |
uint16_t (map_get_width) (const map_t *p){ return sprite_get_w(p->background); } |
290 | 290 |
uint16_t (map_get_height) (const map_t *p){ return sprite_get_h(p->background); } |
291 | 291 |
int (map_collides_point)(const map_t *p, double x, double y){ |
proj/src/interrupts_func.c | ||
---|---|---|
115 | 115 |
uart_set_bits_per_character(COM1_ADDR, 8); |
116 | 116 |
uart_set_stop_bits (COM1_ADDR, 2); |
117 | 117 |
uart_set_parity (COM1_ADDR, uart_parity_even); |
118 |
uart_set_bit_rate (COM1_ADDR, 38400);
|
|
118 |
uart_set_bit_rate (COM1_ADDR, 115200);
|
|
119 | 119 |
uart_enable_int_rx (COM1_ADDR); |
120 | 120 |
uart_enable_int_tx(COM1_ADDR); |
121 | 121 |
if(subscribe_uart_interrupt(COM1_IRQ, &uart_id)) { |
proj/src/proj.c | ||
---|---|---|
62 | 62 |
static int (multiplayer)(void); |
63 | 63 |
static int (chat)(void); |
64 | 64 |
int(proj_main_loop)(int argc, char *argv[]) { |
65 |
(void)argc; (void)argv; |
|
65 | 66 |
|
66 | 67 |
int r; |
67 | 68 |
|
proj/Makefile | ||
---|---|---|
12 | 12 |
SRCS= list.c queue.c graph.c kbc.c keyboard.c mouse.c utils.c timer.c interrupts_func.c fast_math.c xpm_utils.c rtc.c uart.c makecode_map.c menu.c proj_func.c rectangle.c font.c ent.c proj.c hltp.c |
13 | 13 |
IPATHS=-I./include -I./libs/graph/include -I./libs/kbc/include -I./libs/rtc/include -I./libs/timer/include -I./libs/uart/include -I./libs/classes/include -I./libs/utils/include -I./maps -I./media/xpm |
14 | 14 |
|
15 |
CPPFLAGS += -pedantic ${IPATHS} -D LCOM_MACRO -D __LCOM_OPTIMIZED__ #-Weverything -Wno-padded -Wno-unused-macros |
|
15 |
CPPFLAGS += -pedantic ${IPATHS} -D LCOM_MACRO -D __LCOM_OPTIMIZED__ -Wall -Wextra -Wshadow -Wunreachable-code #-Weverything -Wno-padded -Wno-unused-macros
|
|
16 | 16 |
|
17 | 17 |
|
18 | 18 |
DPADD += ${LIBLCF} |
proj/tasks.md | ||
---|---|---|
4 | 4 |
- [ ] Implement multiplayer 1v1 game and win condition to reach N kills. |
5 | 5 |
- [ ] Leaderboard of fastest win, or any achievement (to make use of RTC). |
6 | 6 |
- [ ] Documentation |
7 |
- [ ] Small schemes for report, generated by Doxygen |
|
7 | 8 |
- [ ] Report |
8 | 9 |
|
9 | 10 |
### Mid priority |
Also available in: Unified diff