Skip to content
Snippets Groups Projects
errors.c 901 B
Newer Older
/* 
 * File:   errors.c
 * Author: Carlo Alessandro Nicolau @ INFN
 * 
 * Firmware for BPD board.
 * Error-related functions.
 */

#include "errors.h"
#include "hardware.h"
#include "errorcodes.h"

err_t errors_last_error = NOERR;

void error_notify(err_t _err) {
    // do nothing special, just set the value to be remembered
    // notify one error (probably to remove on final version)
    errors_last_error = _err;
    
    // T O D O DEBUG remove USER PIN activity
    //    DIGITAL_OUT_USER_J1_1_SetHigh();
    //    DIGITAL_OUT_USER_J1_1_SetLow();
}

void error_die_forever(void) {    
    // THIS SHOULD NEVE HAPPEN, PLEASE UNCOMMENT DURING DEVELOPMENT
    //    INTERRUPT_GlobalInterruptDisable();
    //    while(1) {
    //        DIGITAL_OUT_USER_J1_1_SetHigh();
    //        __delay_ms(250);
    //        DIGITAL_OUT_USER_J1_1_SetLow();
    //        __delay_ms(250);
    //    }    
}