Project

General

Profile

Revision 325

some more changes to uart

View differences:

proj/libs/uart/include/uart.h
55 55
int nctp_set_processor(void (*proc_func)(const uint8_t*, const size_t));
56 56
int nctp_free(void);
57 57

  
58
int nctp_send(size_t num, uint8_t* ptr[], size_t sz[]);
58
int nctp_send(size_t num, const uint8_t *const *ptr, const size_t *const sz);
59 59

  
60 60
int (nctp_get_ih_error)(void);
61 61
void nctp_ih(void);
proj/libs/uart/src/hltp.c
52 52
int hltp_send_host_info(const host_info_t *p) {
53 53

  
54 54
    uint8_t type = hltp_type_host;
55
    uint8_t* ptr[17]; size_t sz[17];
55
    const uint8_t* ptr[17]; size_t sz[17];
56 56
    ptr[0]  = (uint8_t*)&   type                  ;     sz[0]   = 1;
57 57
    ptr[1]  = (uint8_t*)&p->host_x                ;     sz[1]   = sizeof(double);
58 58
    ptr[2]  = (uint8_t*)&p->host_y                ;     sz[2]   = sizeof(double);
......
87 87
int hltp_send_remote_info(const remote_info_t *p) {
88 88

  
89 89
    uint8_t type = hltp_type_remote;
90
    uint8_t* ptr[3]; size_t sz[3];
90
    const uint8_t* ptr[3]; size_t sz[3];
91 91
    ptr[0]  = (uint8_t*)&   type                  ;     sz[0] = 1;
92 92
    ptr[1]  = (uint8_t*)&p->remote_keys_pressed   ;     sz[1] = sizeof(keys_t);
93 93
    ptr[2]  = (uint8_t*)&p->remote_angle          ;     sz[2] = sizeof(double);
......
103 103

  
104 104
int hltp_send_bullet_info(const bullet_info_t *p) {
105 105
    uint8_t type = hltp_type_bullet;
106
    uint8_t* ptr[2]; size_t sz[2];
106
    const uint8_t* ptr[2]; size_t sz[2];
107 107
    ptr[0]  = (uint8_t*)&   type            ;     sz[0] = 1;
108 108
    ptr[1]  = (uint8_t*)&p->new_bullet      ;     sz[1] = sizeof(bool);
109 109
    return nctp_send(2, ptr, sz);
proj/libs/uart/src/uart.c
313 313
    return SUCCESS;
314 314
}
315 315

  
316
int nctp_send(size_t num, uint8_t* ptr[], size_t sz[]){
316
int nctp_send(size_t num, const uint8_t *const *ptr, const size_t *const sz){
317 317
    int ret;
318 318
    uint8_t *tmp;
319 319
    tmp = malloc(sizeof(uint8_t)); *tmp = NCTP_START; queue_push(out, tmp);
320 320
    for(size_t i = 0; i < num; ++i){
321
        uint8_t *p = ptr[i]; size_t s = sz[i];
321
        const uint8_t *p = ptr[i]; const size_t s = sz[i];
322 322
        for(size_t j = 0; j < s; ++j, ++p){
323 323
            tmp = malloc(sizeof(uint8_t)); *tmp = *p; queue_push(out, tmp);
324 324
        }
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__ #-Weverything -Wno-padded -Wno-unused-macros
16 16

  
17 17

  
18 18
DPADD += ${LIBLCF}

Also available in: Unified diff