Project

General

Profile

Revision 90

docs and error changes

View differences:

lab4/errors.h
12 12
    TIMEOUT_ERROR,      /* @brief Timeout error */
13 13
    INVALID_COMMAND,    /* @brief Invalid Command issued */
14 14
    INVALID_STATE,      /* @brief State machine reached an invalid state */
15
    INVALID_ARGUMENT,   /* @brief Invalid argument received */
16 15
    OTHER_ERROR         /* @brief Unspecified error */
17 16
};
18 17

  
lab4/kbc.h
33 33
 * High-level function that restores KBC to normal state, because lcf_start
34 34
 * changes the command byte of KBC. If this function is not used, there is a
35 35
 * chance that the keyboard and keyboard interrupts remain disabled.
36
 * @return 1 if operation was successful, 1 otherwise
36
 * @return 0 if operation was successful, 1 otherwise
37 37
 */
38 38
int (kbc_restore_keyboard)();
39 39

  
lab4/keyboard.c
29 29
        return;
30 30
    }
31 31
    if ((status & OUT_BUF_FUL) == 0 || (status & AUX_MOUSE) != 0) {
32
        got_error_keyboard = OTHER_ERROR;
32
        got_error_keyboard = READ_ERROR;
33 33
        return;
34 34
    }
35 35
    uint8_t byte = 0;
lab4/mouse.c
29 29
        return;
30 30
    }
31 31
    if (((status & AUX_MOUSE) == 0) || ((status & OUT_BUF_FUL) == 0)) {
32
        got_error_mouse_ih = OTHER_ERROR;
32
        got_error_mouse_ih = READ_ERROR;
33 33
        return;
34 34
    }
35 35

  
lab4/timer.h
7 7

  
8 8
#include <stdint.h>
9 9

  
10
/**
11
 * @brief Subscribes Timer Interrupts and disables Minix Default IH
12
 * @param interrupt_bit Bit of Interrupt Vector that will be set when Timer Interrupt is pending
13
 * @param interrupt_id Timer Interrupt ID to specify the Timer Interrupt in other calls
14
 * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
15
 * @see {_ERRORS_H_::errors}
16
 */
10 17
int (subscribe_timer_interrupt)(uint8_t interrupt_bit, int *interrupt_id);
11 18

  
12 19
int no_interrupts;
lab4/utils.h
1 1
#ifndef UTILS_H_INCLUDED
2 2
#define UTILS_H_INCLUDED
3 3

  
4
/**
5
 * @brief Gets the least significant byte of a 16-bit variable
6
 * @param val 16-bit variable
7
 * @param lsb Pointer to a 8-bit variable to store the value of the LSB
8
 * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
9
 */
4 10
int(util_get_LSB)(uint16_t val, uint8_t *lsb);
5 11

  
12
/**
13
 * @brief Gets the most significant byte of a 16-bit variable
14
 * @param val 16-bit variable
15
 * @param lsb Pointer to a 8-bit variable to store the value of the MSB
16
 * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
17
 */
6 18
int(util_get_MSB)(uint16_t val, uint8_t *msb);
7 19

  
8 20
#ifdef LAB3
9 21
    uint32_t sys_inb_counter;
10 22
#endif
11 23

  
24
/**
25
 * @brief sys_inb wrapper
26
 * @param port Port to read from
27
 * @param value Pointer to byte to store value read
28
 * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
29
 */
12 30
int (util_sys_inb)(int port, uint8_t *value);
13 31

  
14 32
#endif //UTILS_H_INCLUDED

Also available in: Unified diff