1
0
mirror of https://github.com/Oleg-Stepanenko-owo/IEBUS synced 2025-06-22 07:16:13 +00:00

added freeze after Honda/GVN display swithcing

This commit is contained in:
OlegStepanenko_noute 2016-03-14 20:25:55 +02:00
parent baf4818bcf
commit d9e0f0bd9d
3 changed files with 18 additions and 3 deletions

View File

@ -50,8 +50,10 @@ void AVCLanHonda::begin()
bHondaDisLast = false; bHondaDisLast = false;
bShowRearCam = false; bShowRearCam = false;
bFirstStart_20 = true; bFirstStart_20 = true;
bFreeze = false;
setWaitTime( 0L ); setWaitTime( 0L );
freezeTime = 0L;
// timer1 setup, prescaler factor - 1024 // timer1 setup, prescaler factor - 1024
TCCR1A = 0; // normal mode TCCR1A = 0; // normal mode
@ -112,9 +114,12 @@ void AVCLanHonda::processAction( AvcActionID ActionID )
case ACT_DISP_OFF: case ACT_DISP_OFF:
if ( !bShowRearCam ) if ( !bShowRearCam )
{ {
// need freeze on 2000 sec after code receiving.
bShowHondaDisp = false; bShowHondaDisp = false;
bHondaDisLast = false; bHondaDisLast = false;
setWaitTime(0L); setWaitTime(0L);
bFreeze = true;
freezeTime = (millis() + FREEZE_TIME);
} }
break; break;
case ACT_CAM_OFF: case ACT_CAM_OFF:

View File

@ -30,7 +30,7 @@
#define AVCLANDEVICE_VERSION "0.1.0" #define AVCLANDEVICE_VERSION "0.1.0"
#define BUTT_WAIT 1000 #define BUTT_WAIT 1000
#define LOCK_TIME 700 #define FREEZE_TIME 1500
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
typedef enum { typedef enum {
@ -74,14 +74,17 @@ class AVCLanHonda
void checkLock(); void checkLock();
void setHondaDis( bool val ); void setHondaDis( bool val );
bool bFreeze;
bool bFirstStart_20; bool bFirstStart_20;
unsigned long freezeTime;
private: private:
unsigned long waitTime; unsigned long waitTime;
// unsigned long lockTime;
bool bWait; bool bWait;
bool bLock;
bool bShowRearCam; bool bShowRearCam;
bool bShowHondaDisp; bool bShowHondaDisp;

View File

@ -33,6 +33,13 @@ void loop()
avclanHonda.setHondaDis( false ); //Show GVN screen avclanHonda.setHondaDis( false ); //Show GVN screen
} }
if ( avclanHonda.bFreeze ) {
if ( avclanHonda.freezeTime < millis() ) {
avclanHonda.bFreeze = false;
avclanHonda.freezeTime = 0L;
} else return;
}
if ( INPUT_IS_SET ) { if ( INPUT_IS_SET ) {
byte res = avclan.readMessage(); byte res = avclan.readMessage();
if ( !res ) { if ( !res ) {