Fixed typos
This commit is contained in:
@@ -79,7 +79,7 @@ void TimerEvent_handling(Timing_RTC event){
|
||||
}
|
||||
printf("\r\nCHx Closs : ");
|
||||
for (j = 0; j < Relay_Number_MAX; j++) {
|
||||
if(*(&(event.Relay_CH1)+j) == STATE_Closs)
|
||||
if(*(&(event.Relay_CH1)+j) == STATE_Close)
|
||||
printf("CH%d ", j+1);
|
||||
}
|
||||
if(Retain_channels){
|
||||
@@ -233,7 +233,7 @@ void TimerEvent_CHxn_Set(datetime_t time,Status_adjustment *Relay_n, Repetition_
|
||||
for (int i = 0; i < Relay_Number_MAX; i++) {
|
||||
if(Relay_n[i] == STATE_Open)
|
||||
printf("Open ");
|
||||
else if(Relay_n[i] == STATE_Closs)
|
||||
else if(Relay_n[i] == STATE_Close)
|
||||
printf("Closs ");
|
||||
else if(Relay_n[i] == STATE_Retain)
|
||||
printf("Retain ");
|
||||
@@ -253,7 +253,7 @@ void TimerEvent_CHxn_Set(datetime_t time,Status_adjustment *Relay_n, Repetition_
|
||||
for (int i = 0; i < Relay_Number_MAX; i++) {
|
||||
if (Relay_n[i] == STATE_Open)
|
||||
len += snprintf(Event_content + len, sizeof(Event_content) - len, "Open ");
|
||||
else if(Relay_n[i] == STATE_Closs)
|
||||
else if(Relay_n[i] == STATE_Close)
|
||||
len += snprintf(Event_content + len, sizeof(Event_content) - len, "Closs ");
|
||||
else if(Relay_n[i] == STATE_Retain)
|
||||
len += snprintf(Event_content + len, sizeof(Event_content) - len, "Retain ");
|
||||
@@ -312,7 +312,7 @@ void TimerEvent_printf(Timing_RTC event){
|
||||
}
|
||||
printf("\r\nCHx Closs : ");
|
||||
for (j = 0; j < Relay_Number_MAX; j++) {
|
||||
if(open[j] == STATE_Closs)
|
||||
if(open[j] == STATE_Close)
|
||||
printf("CH%d ", j+1);
|
||||
}
|
||||
printf("\r\nCHx Retain : ");
|
||||
|
||||
@@ -11,7 +11,7 @@ bool Relay_Open(uint8_t CHx)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
bool Relay_Closs(uint8_t CHx)
|
||||
bool Relay_Close(uint8_t CHx)
|
||||
{
|
||||
if(!Set_EXIO(CHx, false)){
|
||||
printf("Failed to Closs CH%d!!!\r\n", CHx);
|
||||
@@ -35,7 +35,7 @@ bool Relay_CHx(uint8_t CHx, bool State)
|
||||
if(State)
|
||||
result = Relay_Open(CHx);
|
||||
else
|
||||
result = Relay_Closs(CHx);
|
||||
result = Relay_Close(CHx);
|
||||
if(!result)
|
||||
Failure_Flag = 1;
|
||||
return result;
|
||||
@@ -233,12 +233,12 @@ void Relay_Immediate_CHxn(Status_adjustment * Relay_n, uint8_t Mode_Flag)
|
||||
else if(Mode_Flag == RTC_Mode)
|
||||
printf("RTC Data :\r\n");
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if(Relay_n[i] == STATE_Open || Relay_n[i] == STATE_Closs){
|
||||
if(Relay_n[i] == STATE_Open || Relay_n[i] == STATE_Close){
|
||||
Relay_Flag[i] = (bool)Relay_n[i];
|
||||
ret = Relay_CHx(i+1,Relay_n[i]);
|
||||
if(Relay_n[i] == STATE_Open)
|
||||
printf("|*** Relay CH%d on ***|\r\n",i+1);
|
||||
else if(Relay_n[i] == STATE_Closs)
|
||||
else if(Relay_n[i] == STATE_Close)
|
||||
printf("|*** Relay CH%d off ***|\r\n",i+1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#define RTC_Mode 6
|
||||
|
||||
typedef enum {
|
||||
STATE_Closs = 0, // Closs Relay
|
||||
STATE_Close = 0, // Closs Relay
|
||||
STATE_Open = 1, // Open Relay
|
||||
STATE_Retain = 2, // Stay in place
|
||||
} Status_adjustment;
|
||||
@@ -44,7 +44,7 @@ typedef enum {
|
||||
extern bool Relay_Flag[8]; // Relay current status flag
|
||||
|
||||
void Relay_Init(void);
|
||||
bool Relay_Closs(uint8_t CHx);
|
||||
bool Relay_Close(uint8_t CHx);
|
||||
bool Relay_Open(uint8_t CHx);
|
||||
bool Relay_CHx_Toggle(uint8_t CHx);
|
||||
bool Relay_CHx(uint8_t CHx, bool State);
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace drivers
|
||||
|
||||
const bool TCA9554PWR::writeRegister(const uint8_t reg, const uint8_t val)
|
||||
{
|
||||
if (m_i2c.Write(m_address, reg, {val}))
|
||||
if (m_i2c.write(m_address, reg, {val}))
|
||||
return true;
|
||||
log_e("Unable to write register: reg[%d], val[%d] ", reg, val);
|
||||
return false;
|
||||
@@ -20,7 +20,7 @@ namespace drivers
|
||||
const bool TCA9554PWR::readRegister(const uint8_t reg, uint8_t &val)
|
||||
{
|
||||
std::vector<uint8_t> data;
|
||||
if (m_i2c.Read(m_address, reg, 1, data))
|
||||
if (m_i2c.read(m_address, reg, 1, data))
|
||||
{
|
||||
val = data.back();
|
||||
return true;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace drivers
|
||||
isInitialized = true;
|
||||
}
|
||||
|
||||
const bool I2C::Read(const uint8_t deviceAddr, const uint8_t deviceReg, const uint8_t len, std::vector<uint8_t> &data)
|
||||
const bool I2C::read(const uint8_t deviceAddr, const uint8_t deviceReg, const uint8_t len, std::vector<uint8_t> &data)
|
||||
{
|
||||
busy.try_lock();
|
||||
Wire.beginTransmission(deviceAddr);
|
||||
@@ -49,7 +49,7 @@ namespace drivers
|
||||
return true;
|
||||
}
|
||||
|
||||
const bool I2C::Write(const uint8_t deviceAddr, const uint8_t deviceReg, const std::vector<uint8_t> &data)
|
||||
const bool I2C::write(const uint8_t deviceAddr, const uint8_t deviceReg, const std::vector<uint8_t> &data)
|
||||
{
|
||||
busy.lock();
|
||||
Wire.beginTransmission(deviceAddr);
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace drivers
|
||||
I2C(void);
|
||||
~I2C(void);
|
||||
|
||||
const bool Read(const uint8_t deviceAddr, const uint8_t deviceReg, const uint8_t len, std::vector<uint8_t> &data);
|
||||
const bool Write(const uint8_t deviceAddr, const uint8_t deviceReg, const std::vector<uint8_t> &data);
|
||||
const bool read(const uint8_t deviceAddr, const uint8_t deviceReg, const uint8_t len, std::vector<uint8_t> &data);
|
||||
const bool write(const uint8_t deviceAddr, const uint8_t deviceReg, const std::vector<uint8_t> &data);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user