|
|
@@ -249,13 +249,34 @@ eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegi
|
|
|
{
|
|
|
if(WusNRegs == RelaySlaveChaNum && start == 0)
|
|
|
{
|
|
|
- for(uint8_t j = 0; j < PT_SUB_COUNT;j++)
|
|
|
+ if((RelaySlaveChaNum == 1) && ((usRegHoldBuf[WiRegIndex] & (1<<11))==0) && ((usRegHoldBuf[WiRegIndex] & (1<<12))==0))
|
|
|
{
|
|
|
- da.channel = j;
|
|
|
- da.method = DELAY_CTRL;
|
|
|
- da.reg = &board->relay_staging_staus[j];
|
|
|
- da.status = (usRegHoldBuf[WiRegIndex+j] & 0x1);
|
|
|
- set_relay_sta_async(&da);
|
|
|
+ for(uint8_t j = 0; j < RelaySlaveChaNum;j++)
|
|
|
+ {
|
|
|
+#if SUPPORT_SELF_LOCK
|
|
|
+ if(board->val_key[j] == 0)
|
|
|
+ continue;
|
|
|
+#endif
|
|
|
+ da.channel = j;
|
|
|
+ da.method = PROMPT_CTRL;
|
|
|
+ da.reg = &board->relay_staging_staus[j];
|
|
|
+ da.status = (usRegHoldBuf[WiRegIndex+j] & 0x1);
|
|
|
+ set_relay_sta_async(&da);
|
|
|
+ }
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ for(uint8_t j = 0; j < PT_SUB_COUNT;j++)
|
|
|
+ {
|
|
|
+#if SUPPORT_SELF_LOCK
|
|
|
+ if(board->val_key[j] == 0)
|
|
|
+ continue;
|
|
|
+#endif
|
|
|
+ da.channel = j;
|
|
|
+ da.method = DELAY_CTRL;
|
|
|
+ da.reg = &board->relay_staging_staus[j];
|
|
|
+ da.status = (usRegHoldBuf[WiRegIndex+j] & 0x1);
|
|
|
+ set_relay_sta_async(&da);
|
|
|
+ }
|
|
|
}
|
|
|
}else
|
|
|
{
|
|
|
@@ -271,6 +292,10 @@ eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegi
|
|
|
}
|
|
|
for(uint8_t j = 0; j < count;j++)
|
|
|
{
|
|
|
+#if SUPPORT_SELF_LOCK
|
|
|
+ if(board->val_key[start+j] == 0)
|
|
|
+ continue;
|
|
|
+#endif
|
|
|
da.channel = start + j;
|
|
|
da.method = PROMPT_CTRL;
|
|
|
da.reg = &board->relay_staging_staus[start+j];
|