コード例 #1
0
static void A66_Charging_FSM_onCableInOut(struct AXC_Charging_FSM *_this, AXE_Charger_Type type)
{
    CHARGING_FSM_STRESS_TEST_DEBUG_JUST_FUN_NAME();

    if(type == NO_CHARGER_TYPE) {

        _this->statePointerList[_this->currentState]->handle(
            _this->statePointerList[_this->currentState],
            CABLE_OUT_EVENT,
            NO_CHARGER_TYPE,
            NO_ERROR
        );

    } else if(type > NO_CHARGER_TYPE && type <CHARGING_TYPE_COUNT) {

        _this->statePointerList[_this->currentState]->handle(
            _this->statePointerList[_this->currentState],
            CABLE_IN_EVENT,
            type,
            NO_ERROR
        );

    } else {

        printk(KERN_ERR"%s:param error!!skip it.\n",__FUNCTION__);
    }

    CHARGING_FSM_STRESS_TEST_DEBUG("---");
}
コード例 #2
0
static void AXC_FSM_Stress_Tester_enable(struct AXC_FSM_Stress_Tester *_this, bool enabled)
{
    if(enabled){

        CHARGING_FSM_STRESS_TEST_DEBUG("enabled...");

        _this->filereader.miParent.test(&_this->filereader.miParent, NULL);
    }
}
コード例 #3
0
static void AXC_FSM_Stress_Tester_parse(struct AXC_FeedingFileInputParser *parser, unsigned int size)
{
    /*

    AXC_FSM_Stress_A_Set_of_Test_Content *content;

    struct AXC_FSM_Stress_Tester  *_this=
        container_of(parser, AXC_FSM_Stress_Tester, parser);

    AXC_Charging_FSM *lpFSM = getChargingFSM(E_ASUS_A66_FSM_CHARGING_TYPE,NULL);

    int index =0;

    CHARGING_FSM_STRESS_TEST_DEBUG("...Start");

    CHARGING_FSM_STRESS_TEST_DEBUG_1_STR_1_INT("filesize",size);

    while(size > index*sizeof(AXC_FSM_Stress_A_Set_of_Test_Content)){

        CHARGING_FSM_STRESS_TEST_DEBUG_1_STR_1_INT("times",index);

        content = (AXC_FSM_Stress_A_Set_of_Test_Content*)(&_this->buf[index*sizeof(AXC_FSM_Stress_A_Set_of_Test_Content)]);

        CHARGING_FSM_STRESS_TEST_DEBUG_1_STR_1_INT("state",content->state);
        CHARGING_FSM_STRESS_TEST_DEBUG_1_STR_1_INT("event",content->event);
        CHARGING_FSM_STRESS_TEST_DEBUG_1_STR_1_INT("type",content->type);
        CHARGING_FSM_STRESS_TEST_DEBUG_1_STR_1_INT("errorCode",content->errorCode);
        CHARGING_FSM_STRESS_TEST_DEBUG_1_STR_1_INT("predictState",content->predictState);
        CHARGING_FSM_STRESS_TEST_DEBUG_1_STR_1_INT("predictType",content->predictType);
        CHARGING_FSM_STRESS_TEST_DEBUG_1_STR_1_INT("predictErrorReason",content->predictErrorReason);

        //pass condition & event to FSM
        lpFSM->currentState = (AXE_Charging_State)content->state;

        switch((AXE_Charger_Event)content->event){

            case CABLE_IN_EVENT:
            case CABLE_OUT_EVENT:
                lpFSM->onCableInOut(lpFSM, (AXE_Charger_Type)content->type);
                break;
            case CHARGING_STOP_EVENT:
            case CHARGING_DONE_EVENT:
                lpFSM->onChargingStop(lpFSM,(AXE_Charging_Error_Reason)content->predictErrorReason);
                break;
            case CHARGING_RESUME_EVENT:
                lpFSM->onChargingStart(lpFSM);
                break;
            default:
                break;
        }

        //check if the result is correct or not
        //BUG_ON((AXE_Charging_State)content->predictState != lpFSM->currentState);
        //BUG_ON((AXE_Charger_Type)content->predictType!= lpFSM->chargerType);
        //BUG_ON((AXE_Charging_Error_Reason)content->predictErrorReason!= lpFSM->lastChargingErrorReason);
        
        index ++;
    }
*/
    CHARGING_FSM_STRESS_TEST_DEBUG("...End");
}