extern void eo_currents_watchdog_Tick(EOCurrentsWatchdog* p, int16_t voltage, int16_t *currents)
{

    if (p == NULL)
    {
        return;
    }
    
    int16_t current_value = 0;

    for (uint8_t i = 0; i < s_eo_currents_watchdog.numberofmotors; i++)
    {
        //get current value
        current_value = currents[i];
        
        //Update currents broadcasted
        //s_eo_currents_watchdog_UpdateMotorCurrents(i, current_value);
        MController_update_motor_current_fbk(i, current_value);
        
        // moved into s_eo_currents_watchdog_UpdateMotorCurrents
        //error flags signalling is done internally
        //s_eo_currents_watchdog_CheckSpike(i, current_value);
        
        s_eo_currents_watchdog_CheckI2T(i, current_value);
        

        //added following code only 4 debug purpose
        if(current_value > maxReadCurrent[i])
        {
            maxReadCurrent[i] = current_value;
//            if(0 == i)//only for first joint
//            {
//                
//                eOerrmanDescriptor_t errdes = {0};
//                errdes.code                 = eoerror_code_get(eoerror_category_Debug, eoerror_value_DEB_tag00);
//                errdes.par16                = i;
//                errdes.sourcedevice         = eo_errman_sourcedevice_localboard;
//                errdes.sourceaddress        = 0;  
//                char str[eomn_info_status_extra_sizeof];
//                snprintf(str, sizeof(str), "NEW MAX CURR VAL: =%d ", current_value);
//                eo_errman_Error(eo_errman_GetHandle(), eo_errortype_debug, str, NULL, &errdes);
//            }
        }

    }
    
    
    // in here i proces the voltage
    {
        suppliedVoltage_counter++;
        
        if(suppliedVoltage_counter < SUMMPLIED_VOLTAGE_COUNTER_MAX)
            return;
        
        nv_controller_ptr->status.supplyVoltage = voltage;
        suppliedVoltage_counter = 0;               
    }
    
    
}
extern void eo_currents_watchdog_Tick(EOCurrentsWatchdog* p)
{
	if (p == NULL)
    {
        return;
    }
    
    int16_t current_value = 0;
    //check spikes and I2T
    for (uint8_t i = 0; i < s_eo_currents_watchdog.numberofmotors; i++)
    {
        //get current value
        current_value = eo_mcserv_GetMotorCurrent (eo_mcserv_GetHandle(), i);
        
        //Update currents broadcasted
        s_eo_currents_watchdog_UpdateMotorCurrents(i, current_value);
        
        //error flags signalling is done internally
        s_eo_currents_watchdog_CheckSpike(i, current_value);
        s_eo_currents_watchdog_CheckI2T(i, current_value);
    }
    
}