bengtmartensson/Infrared4Arduino

Fix silly #if in PinModeStatus.h

bengtmartensson opened this issue · 1 comments

The idea is to define the enums PinStatus and PinMode unless they are defined already. The present solution brings in hardware dependencies where it does not belong, and it sometimes breaks with unknown boards (#53).

Problem might lie with ~/.arduino15/packages/arduino/hardware/megaavr/1.8.6/cores/arduino/api/Common.h which defines these enums.

Task is to find a clean solution.

The problem is described (and discussed) here. Some boards define enums PortStatus and PortMode, the other uses macros for INPUT etc. I selected the following logic:

If LOW is defined, then it is assumed that the enums are not defined, so I undefine LOW etc, and define the enums.

Isn't Arduino wonderful?