Beispiel #1
0
void dump_cs_debug(const char *name, struct cs *cs)
{
	DEBUG(E_USER_CS, "%s cons=% .5ld fcons=% .5ld err=% .5ld "
	      "in=% .5ld out=% .5ld", 
	      name, cs_get_consign(cs), cs_get_filtered_consign(cs),
	      cs_get_error(cs), cs_get_filtered_feedback(cs),
	      cs_get_out(cs));
}
Beispiel #2
0
void dump_cs(const char *name, struct cs *cs)
{
	printf_P(PSTR("%s cons=% .5ld fcons=% .5ld err=% .5ld "
		      "in=% .5ld out=% .5ld\r\n"), 
		 name, cs_get_consign(cs), cs_get_filtered_consign(cs),
		 cs_get_error(cs), cs_get_filtered_feedback(cs),
		 cs_get_out(cs));
}
// function to be called periodically
void bd_manage( struct blocking_detection * bd )
{
    uint32_t err = ABS( cs_get_error( bd->cs ) );
    
    if( 0 == bd->err_thres ) 
    {   
        return;
    }
    if( bd->err_max < err )
    {
        bd->err_max = err;
    }
    if( err > bd->err_thres ) 
    {
        bd->cpt++;
    }
    else 
    {
        bd->cpt=0;
    }
}