Skip to content

Commit cff4979

Browse files
committed
reverse macros
1 parent 9ec132c commit cff4979

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/CEC/CEC_Device.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
#if defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F2) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4)
55
# define STM32
6-
# define CECLOW 1
7-
# define CECHIGH 0
6+
# define CEC_HIGH 1
7+
# define CEC_LOW 0
88
#else
9-
# define CECLOW LOW
10-
# define CECHIGH HIGH
9+
# define CEC_HIGH LOW
10+
# define CEC_LOW HIGH
1111
#endif
1212

1313
CEC_Device::CEC_Device(int physicalAddress, int in_line, int out_line)
@@ -23,14 +23,13 @@ void CEC_Device::Initialize(CEC_DEVICE_TYPE type)
2323
{
2424
#ifdef STM32
2525
gpio_set_mode(digitalPinToPort(_in_line), PIN_MAP[_in_line].gpio_bit, GPIO_OUTPUT_OD); // set open drain output
26-
digitalWrite(_in_line,1);
2726
_out_line = _in_line;
2827
#else
2928
pinMode(_out_line, OUTPUT);
3029
pinMode( _in_line, INPUT);
3130
#endif
3231

33-
digitalWrite(_out_line, CECLOW);
32+
digitalWrite(_out_line, CEC_HIGH);
3433
delay(200);
3534

3635
CEC_LogicalDevice::Initialize(type);
@@ -57,12 +56,12 @@ void CEC_Device::OnReceive(int source, int dest, unsigned char* buffer, int coun
5756
bool CEC_Device::LineState()
5857
{
5958
int state = digitalRead(_in_line);
60-
return state == CECLOW;
59+
return state == CEC_HIGH;
6160
}
6261

6362
void CEC_Device::SetLineState(bool state)
6463
{
65-
digitalWrite(_out_line, state?CECLOW:CECHIGH);
64+
digitalWrite(_out_line, state?CEC_HIGH:CEC_LOW);
6665
// give enough time for the line to settle before sampling
6766
// it
6867
delayMicroseconds(50);

0 commit comments

Comments
 (0)