Revision 65
changes
lab3/lab3.c | ||
---|---|---|
121 | 121 |
case HARDWARE: /* hardware interrupt notification */ |
122 | 122 |
if (msg.m_notify.interrupts & timer_irq) { /* subscribed interrupt */ |
123 | 123 |
timer_int_handler(); |
124 |
//printf("no_interrupts: %d\n", no_interrupts); |
|
125 | 124 |
if (no_interrupts%frequency == 0) time++; |
126 | 125 |
if(time >= idle) good = 0; |
127 | 126 |
} |
lab3/utils.c | ||
---|---|---|
2 | 2 |
|
3 | 3 |
#include <stdint.h> |
4 | 4 |
|
5 |
int(util_get_LSB)(uint16_t val, uint8_t *lsb) { |
|
6 |
if (lsb == NULL) return 1; |
|
7 |
*lsb = val; |
|
8 |
return 0; |
|
9 |
} |
|
10 |
|
|
11 |
int(util_get_MSB)(uint16_t val, uint8_t *msb) { |
|
12 |
if (msb == NULL) return 1; |
|
13 |
*msb = (val >> 8); |
|
14 |
return 0; |
|
15 |
} |
|
16 |
|
|
5 | 17 |
#ifdef LAB3 |
6 | 18 |
uint32_t sys_inb_counter = 0; |
7 | 19 |
#endif |
lab3/utils.h | ||
---|---|---|
1 | 1 |
#ifndef UTILS_H_INCLUDED |
2 | 2 |
#define UTILS_H_INCLUDED |
3 | 3 |
|
4 |
int(util_get_LSB)(uint16_t val, uint8_t *lsb); |
|
5 |
|
|
6 |
int(util_get_MSB)(uint16_t val, uint8_t *msb); |
|
7 |
|
|
4 | 8 |
#ifdef LAB3 |
5 | 9 |
uint32_t sys_inb_counter; |
6 | 10 |
#endif |
Also available in: Unified diff