Skip to content

Commit

Permalink
PINS_COUNT => NUMBER_PINS_TOTAL
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 12, 2021
1 parent 82acd47 commit c0eb6b0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Marlin/src/HAL/DUE/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
* included just in case.
*/

#define NUMBER_PINS_TOTAL PINS_COUNT

#define digitalRead_mod(p) extDigitalRead(p) // AVR digitalRead disabled PWM before it read the pin
#define PRINT_PORT(p)
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/SAMD51/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
#pragma once

#define NUMBER_PINS_TOTAL PINS_COUNT
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS

#define digitalRead_mod(p) extDigitalRead(p)
#define PRINT_PORT(p) do{ SERIAL_ECHOPGM(" Port: "); sprintf_P(buffer, PSTR("%c%02ld"), 'A' + g_APinDescription[p].ulPort, g_APinDescription[p].ulPin); SERIAL_ECHO(buffer); }while (0)
Expand Down
4 changes: 2 additions & 2 deletions buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ extern const PinDescription g_APinDescription[]=
} ;


uint8_t g_pinStatus[PINS_COUNT] = {0};
uint8_t g_pinStatus[NUMBER_PINS_TOTAL] = {0};

#ifdef __cplusplus
}
Expand Down Expand Up @@ -412,7 +412,7 @@ void init( void )
__libc_init_array();

// Disable pull-up on every pin
for (unsigned i = 0; i < PINS_COUNT; i++)
for (unsigned i = 0; i < NUMBER_PINS_TOTAL; i++)
digitalWrite(i, LOW);

// Enable parallel access on PIO output data registers
Expand Down
4 changes: 2 additions & 2 deletions buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ extern "C"{
*----------------------------------------------------------------------------*/

// Number of pins defined in PinDescription array
#define PINS_COUNT 79
#define NUMBER_PINS_TOTAL 79
#define NUM_DIGITAL_PINS 66
#define NUM_ANALOG_INPUTS 12
#define analogInputToDigitalPin(p) ((p < 12) ? (p) + 54 : -1)
#define analogInputToDigitalPin(p) ((p < NUM_ANALOG_INPUTS) ? (p) + 54 : -1)

#define digitalPinToPort(P) ( g_APinDescription[P].pPort )
#define digitalPinToBitMask(P) ( g_APinDescription[P].ulPin )
Expand Down

0 comments on commit c0eb6b0

Please sign in to comment.