mirror of
https://github.com/Oleg-Stepanenko-owo/IEBUS
synced 2025-06-29 10:46:10 +00:00
added new cam_off sequanse
This commit is contained in:
parent
7ba8949a34
commit
4f208fb733
@ -544,7 +544,12 @@ byte AVCLanDrv::getActionID(const AvcInCmdTable messageTable[], byte mtSize)
|
|||||||
return ACT_NONE;
|
return ACT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte idx = ((dataSize == 8) ? 0 : (dataSize == 9 ? 6 : 9)); // position in AvcInMessageTable
|
// position in AvcInMessageTable
|
||||||
|
byte idx = 0;
|
||||||
|
if (dataSize == 6) idx = 0;
|
||||||
|
else if (dataSize == 8) idx = 1;
|
||||||
|
else if (dataSize == 9) idx = 7;
|
||||||
|
else idx = 10;
|
||||||
|
|
||||||
for (; idx < mtSize; ++idx) {
|
for (; idx < mtSize; ++idx) {
|
||||||
if (dataSize != pgm_read_byte_near(&messageTable[idx].dataSize)) return ACT_NONE; // Because first unsized value from other range
|
if (dataSize != pgm_read_byte_near(&messageTable[idx].dataSize)) return ACT_NONE; // Because first unsized value from other range
|
||||||
|
@ -2,19 +2,30 @@
|
|||||||
#include "limits.h"
|
#include "limits.h"
|
||||||
#include "AVCLanDrv.h"
|
#include "AVCLanDrv.h"
|
||||||
#include "AVCLanHonda.h"
|
#include "AVCLanHonda.h"
|
||||||
|
#include "AVCLan_BT.h"
|
||||||
|
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
//TODO: master -> 131
|
//TODO: master -> 131
|
||||||
|
// < d 183 131 06170D31020158
|
||||||
|
// +++
|
||||||
|
// < d 183 131 08590D31020122712F
|
||||||
|
// Rear camm off
|
||||||
|
|
||||||
// 09780D3103024B000009 - next track ?
|
// 09780D3103024B000009 - next track ?
|
||||||
// 08590D3102012212D0
|
// 08590D3102012212D0
|
||||||
// 08590D3102012213D1
|
// 08590D3102012213D1
|
||||||
// 08590D3102012214D2
|
// 08590D3102012214D2
|
||||||
|
// 0618023102004D - mute button press
|
||||||
|
// < d 183 100 0B600D01000140165400000B - time 16:54
|
||||||
|
// < d 100 183 0D60073100010003011018FF5008 - FM1 101.8
|
||||||
|
// 0D60073100010000021014FF5002 - FM2 101.4
|
||||||
|
|
||||||
// { action_name, packed_size, end_off_packege_word(check_sum) }
|
// { action_name, packed_size, end_off_packege_word(check_sum) }
|
||||||
const AvcInCmdTable mtSearchHead[] PROGMEM = {
|
const AvcInCmdTable mtSearchHead[] PROGMEM = {
|
||||||
|
{ ACT_PREP_CAMOFF, 0x06, 0x58}, //06170D31020158
|
||||||
{ ACT_BUTTON_DOWN, 0x08, 0xBC}, // 08590D3102012000BC
|
{ ACT_BUTTON_DOWN, 0x08, 0xBC}, // 08590D3102012000BC
|
||||||
{ ACT_BUTTON_UP, 0x08, 0xBE}, // 08590D3102012101BE
|
{ ACT_BUTTON_UP, 0x08, 0xBE}, // 08590D3102012101BE
|
||||||
{ ACT_B_DISPOFF, 0x08, 0x2F}, // 08590D31020122712F
|
{ ACT_B_DISPOFF, 0x08, 0x2F}, // 08590D31020122712F
|
||||||
@ -37,6 +48,7 @@ void AVCLanHonda::begin()
|
|||||||
{
|
{
|
||||||
avclan.deviceAddress = 0x0131;
|
avclan.deviceAddress = 0x0131;
|
||||||
|
|
||||||
|
bPrepareCamOff = false;
|
||||||
bShowHondaDisp = true;
|
bShowHondaDisp = true;
|
||||||
setHondaDisLast(true);
|
setHondaDisLast(true);
|
||||||
bShowRearCam = false;
|
bShowRearCam = false;
|
||||||
@ -88,6 +100,10 @@ void AVCLanHonda::processAction( AvcActionID ActionID )
|
|||||||
if ( INIT2_TIME < millis() ) bFirstStart_20 = false;
|
if ( INIT2_TIME < millis() ) bFirstStart_20 = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( bPrepareCamOff && (ACT_B_DISPOFF == ActionID) ) {
|
||||||
|
ActionID = ACT_CAM_OFF;
|
||||||
|
avclanBT.print("CAMOFF+DISPOFF");
|
||||||
|
} else bPrepareCamOff = false;
|
||||||
|
|
||||||
switch ( ActionID ) {
|
switch ( ActionID ) {
|
||||||
case ACT_BUTTON_UP:
|
case ACT_BUTTON_UP:
|
||||||
@ -123,6 +139,9 @@ void AVCLanHonda::processAction( AvcActionID ActionID )
|
|||||||
bShowHondaDisp = bHondaDisLast;
|
bShowHondaDisp = bHondaDisLast;
|
||||||
setWaitTime(0L);
|
setWaitTime(0L);
|
||||||
break;
|
break;
|
||||||
|
case ACT_PREP_CAMOFF:
|
||||||
|
bPrepareCamOff = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,7 +44,8 @@ typedef enum {
|
|||||||
ACT_B_DISPFULL_UP,
|
ACT_B_DISPFULL_UP,
|
||||||
ACT_B_DISPHULF,
|
ACT_B_DISPHULF,
|
||||||
ACT_TEL,
|
ACT_TEL,
|
||||||
ACT_TEL_CANCEL
|
ACT_TEL_CANCEL,
|
||||||
|
ACT_PREP_CAMOFF
|
||||||
// ACT_VOL
|
// ACT_VOL
|
||||||
} AvcActionID;
|
} AvcActionID;
|
||||||
|
|
||||||
@ -84,10 +85,9 @@ class AVCLanHonda
|
|||||||
private:
|
private:
|
||||||
unsigned long waitTime;
|
unsigned long waitTime;
|
||||||
|
|
||||||
|
|
||||||
bool bWait;
|
bool bWait;
|
||||||
|
|
||||||
|
bool bPrepareCamOff;
|
||||||
bool bShowRearCam;
|
bool bShowRearCam;
|
||||||
bool bShowHondaDisp;
|
bool bShowHondaDisp;
|
||||||
bool bTimeSwitch;
|
bool bTimeSwitch;
|
||||||
|
@ -161,6 +161,7 @@ void AVCLanBT::printAction( AvcActionID ActionID )
|
|||||||
case ACT_B_DISPHULF: mySerial.println(">>A:B_DISP_HILF<<"); break;
|
case ACT_B_DISPHULF: mySerial.println(">>A:B_DISP_HILF<<"); break;
|
||||||
case ACT_TEL: mySerial.println(">>A:TEL<<"); break;
|
case ACT_TEL: mySerial.println(">>A:TEL<<"); break;
|
||||||
case ACT_TEL_CANCEL: mySerial.println(">>A:TEL CANCEL<<"); break;
|
case ACT_TEL_CANCEL: mySerial.println(">>A:TEL CANCEL<<"); break;
|
||||||
|
case ACT_PREP_CAMOFF: mySerial.println(">>A:PREP_CAMOFF<<"); break;
|
||||||
default: mySerial.println(">>A:UNDEFINED<<");
|
default: mySerial.println(">>A:UNDEFINED<<");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,12 +78,12 @@ void loop()
|
|||||||
avclan.printMessage(true);
|
avclan.printMessage(true);
|
||||||
avclanHonda.getActionID();
|
avclanHonda.getActionID();
|
||||||
|
|
||||||
if ( avclanHonda.bFirstStart_20 && (avclan.actionID == ACT_CAM_ON) )
|
if ( (INIT2_TIME > millis()) && (avclan.actionID == ACT_CAM_ON) )
|
||||||
{
|
{
|
||||||
avclanBT.printAction( (AvcActionID)avclan.actionID );
|
avclanBT.printAction( (AvcActionID)avclan.actionID );
|
||||||
avclanHonda.processAction( (AvcActionID)avclan.actionID );
|
avclanHonda.processAction( (AvcActionID)avclan.actionID );
|
||||||
}
|
}
|
||||||
else if ( (avclan.actionID != ACT_NONE) && ( INIT2_TIME < millis() ) && (!avclanHonda.bFreeze))
|
else if ( (avclan.actionID != ACT_NONE) && ( INIT2_TIME < millis() ) && (!avclanHonda.bFreeze) )
|
||||||
{
|
{
|
||||||
avclanBT.printAction((AvcActionID)avclan.actionID);
|
avclanBT.printAction((AvcActionID)avclan.actionID);
|
||||||
avclanHonda.processAction( (AvcActionID)avclan.actionID );
|
avclanHonda.processAction( (AvcActionID)avclan.actionID );
|
||||||
@ -133,7 +133,7 @@ void loop()
|
|||||||
|
|
||||||
//------- ERROR CHECKING BLOCK ----------------------------------
|
//------- ERROR CHECKING BLOCK ----------------------------------
|
||||||
if ( (error_count > MAX_ERROR_COUNT) && !avclanHonda.isShowHondaDisp() ) {
|
if ( (error_count > MAX_ERROR_COUNT) && !avclanHonda.isShowHondaDisp() ) {
|
||||||
// avclanHonda.bFirstStart_20 = false;
|
// avclanHonda.bFirstStart_20 = false;
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
|
|
||||||
beforeErrorComute = avclanHonda.getCommute();
|
beforeErrorComute = avclanHonda.getCommute();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#define IEBUS_VERSION "0.7"
|
#define IEBUS_VERSION "0.8"
|
||||||
|
|
||||||
// type of AVCLan hardwire driver
|
// type of AVCLan hardwire driver
|
||||||
#define AVCLAN_PCA82C250
|
#define AVCLAN_PCA82C250
|
||||||
|
Loading…
x
Reference in New Issue
Block a user