Revision 145
transfering files
utils.c | ||
---|---|---|
17 | 17 |
return SUCCESS; |
18 | 18 |
} |
19 | 19 |
|
20 |
#ifdef LAB3 |
|
21 |
uint32_t sys_inb_counter = 0; |
|
22 |
#endif |
|
23 |
|
|
24 | 20 |
int (util_sys_inb)(int port, uint8_t *value) { |
25 | 21 |
if(value == NULL) return NULL_PTR; |
26 | 22 |
uint32_t n = 0; |
... | ... | |
29 | 25 |
return SUCCESS; |
30 | 26 |
} |
31 | 27 |
|
32 |
int16_t abs16(int16_t x) { |
|
33 |
return (x >= 0) ? (int16_t)(x) : (int16_t)(-x); |
|
28 |
int (unsubscribe_interrupt)(int *interrupt_id) { |
|
29 |
if (interrupt_id == NULL) return NULL_PTR; |
|
30 |
if(sys_irqrmpolicy(interrupt_id)) return UNSBCR_ERROR; |
|
31 |
return SUCCESS; |
|
34 | 32 |
} |
35 | 33 |
|
36 | 34 |
int16_t min(int16_t a, int16_t b){ return (b < a ? b : a); } |
Also available in: Unified diff