Ejemplo n.º 1
0
extern void eom_emsappl_hid_userdef_on_exit_RUN(EOMtheEMSappl* p)
{
    eOresult_t res = eores_NOK_generic;
    
    // set run mode straigth. then read all can frames received
    eo_canserv_SetMode(eo_canserv_GetHandle(), eocanserv_mode_straight);
    const uint8_t maxframes2read = 255; // 255 is the max number possible. the function however exits when all canframes are 
    eo_canserv_Parse(eo_canserv_GetHandle(), eOcanport1, maxframes2read, NULL);    
    eo_canserv_Parse(eo_canserv_GetHandle(), eOcanport2, maxframes2read, NULL);
  
    
    // stop skin. the check whether to stop skin or not is done internally.
    eo_skin_DisableTX(eo_skin_GetHandle());


    // stop motion control
    res = eo_emsapplBody_DisableTxAllJointOnCan(eo_emsapplBody_GetHandle());
    if (eores_NOK_generic == res)
	{
		// handle the error ... not important
    }
    
    // stop tx of strain, if present
    eo_strain_DisableTX(eo_strain_GetHandle());        
}
Ejemplo n.º 2
0
extern void eom_emsappl_hid_userdef_on_entry_ERR(EOMtheEMSappl* p)
{
    // pulse led3 forever at 4 hz.
    eo_ledpulser_Start(eo_ledpulser_GetHandle(), eo_ledpulser_led_three, EOK_reltime1sec/4, 0);
   
    eo_canserv_SetMode(eo_canserv_GetHandle(), eocanserv_mode_straight);
    const uint8_t maxframes2read = 255; // 255 is the max number possible. the function however exits when all canframes are 
    eo_canserv_Parse(eo_canserv_GetHandle(), eOcanport1, maxframes2read, NULL);    
    eo_canserv_Parse(eo_canserv_GetHandle(), eOcanport2, maxframes2read, NULL);
}
Ejemplo n.º 3
0
extern void eom_emsappl_hid_userdef_on_entry_CFG(EOMtheEMSappl* p)
{    
    // pulse led3 forever at 0.50 hz.
    eo_ledpulser_Start(eo_ledpulser_GetHandle(), eo_ledpulser_led_three, 2*EOK_reltime1sec, 0);

    // set the EOtheCANservice to be on event and force parsing of all packets in the RX queues.
    eo_canserv_SetMode(eo_canserv_GetHandle(), eocanserv_mode_straight);
    const uint8_t maxframes2read = 255; // 255 is the max number possible. the function however exits when all canframes are 
    eo_canserv_Parse(eo_canserv_GetHandle(), eOcanport1, maxframes2read, NULL);    
    eo_canserv_Parse(eo_canserv_GetHandle(), eOcanport2, maxframes2read, NULL);
 
}
// marco.accame on Nov 26 2014: the user-defined emsconfigurator_evt_userdef00 is triggered by the EOtheEMSapplBody to
// tell the EOMtheEMSconfigurator that has received a CAN frame.
extern void eom_emsconfigurator_hid_userdef_ProcessUserdef00Event(EOMtheEMSconfigurator* p)
{
    static uint32_t count_msg = 0;
    count_msg++;
    
   // in here we want to read all can frames that we have on can1 (can2 is not supported on MC4plus)  
    uint8_t numofrxframes = 0;
    
    if(0 != (numofrxframes = eo_canserv_NumberOfFramesInRXqueue(eo_canserv_GetHandle(), eOcanport1)))
    {
        eo_canserv_Parse(eo_canserv_GetHandle(), eOcanport1, numofrxframes, NULL);        
    }
}