//Configure the camera msg_t configureCam(void){ uint8_t tmp; idleState(); //Poweron the camera wakeupCam(); gptPolledDelay(&GPTD3,PWR_DELAY); //Set Default Values cameraWriteCycle( CAM_COM7, 0x80 ); cameraWriteCycle( CAM_CLKRC, 0x80 ); cameraWriteCycle( CAM_COM8, 0x00 ); //Turn off AGC, AWB, AEC for config //Configure the camera for( tmp = 0; tmp < CONFIG_PAIRS; tmp++ ) cameraWriteCycle( cam_config[tmp][0], cam_config[tmp][1] ); tmp = checkCameraSanity(); //powerdownCam(); return (msg_t)tmp; }
void gkGamePlayer::update(gkScalar delta) { if (!m_textInit) { m_textInit = true; setInitialText(); } m_input->updateInputState(); if (m_camera) m_input->moveCamera(); gkFSM::update(); switch (getState()) { case GK_PLAY_IDLE: idleState(); break; case GK_PLAY_WALK: case GK_PLAY_RUN: moveState(); break; case GK_PLAY_JUMP: jumpState(); break; case GK_PLAY_LAND: landState(); break; case GK_PLAY_ATTACK_COMBO: comboState(); break; case GK_PLAY_RUN_ATTACK_0: case GK_PLAY_ATTACK_0: whipState(); break; case GK_PLAY_RUN_ATTACK_1: case GK_PLAY_ATTACK_1: kickState(); break; }/**/ }
//Read reg => retval using two-phase write and read cycle -- requires the timer static uint8_t cameraReadCycle( uint8_t reg ){ uint8_t byte; //Two phase write startCondition(); writeByte(CAM_ADDR_W); writeByte(reg); stopCondition(); idleState(); //Two phase read startCondition(); writeByte(CAM_ADDR_R); byte = readByte(); stopCondition(); return byte; }