1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-30 07:17:59 +00:00

Fix DIGITAL_PIN_TO_ANALOG_PIN macro for Atmega1284p (#9883)

This commit is contained in:
Ben Lye 2018-03-01 21:14:08 +00:00 committed by Scott Lahteine
parent a6326d25fb
commit 432b72e7a8

View File

@ -26,12 +26,13 @@ bool endstop_monitor_flag = false;
// "-" left justify, "28" minimum width of name, pad with blanks
#if AVR_ATmega1284_FAMILY
#define DIGITAL_PIN_TO_ANALOG_PIN(P) int(analogInputToDigitalPin(0) - (P))
#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(7) && (P) <= analogInputToDigitalPin(0))
#else
#define DIGITAL_PIN_TO_ANALOG_PIN(P) int((P) - analogInputToDigitalPin(0))
#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7)))
#endif
/**
* This routine minimizes RAM usage by creating a FLASH resident array to
* store the pin names, pin numbers and analog/digital flag.