Project

General

Profile

Revision 28

minor changes (conversions)

View differences:

lab2/utils.c
4 4

  
5 5
int(util_get_LSB)(uint16_t val, uint8_t *lsb) {
6 6
    if (lsb == NULL) return 1;
7
    *lsb = (uint8_t)val;
7
    *lsb = val;
8 8
    return 0;
9 9
}
10 10

  
11 11
int(util_get_MSB)(uint16_t val, uint8_t *msb) {
12 12
    if (msb == NULL) return 1;
13
    *msb = (uint8_t)(val >> 8);
13
    *msb = (val >> 8);
14 14
    return 0;
15 15
}
16 16

  
......
18 18
    if(value == NULL) return 1;
19 19
    uint32_t n = 0;
20 20
    if(sys_inb(port, &n)) return 1;
21
    *value = (uint8_t)n;
21
    *value = n;
22 22
    return 0;
23 23
}

Also available in: Unified diff