This commit is contained in:
Bob-the-Kuhn
2018-01-01 16:11:56 -06:00
parent d80c4f1a6e
commit adb9ecf3cc
9 changed files with 224 additions and 16 deletions

View File

@ -248,8 +248,12 @@ constexpr pin_t adc_pin_table[] = {
#endif
};
constexpr int16_t NUM_ANALOG_INPUTS = COUNT(adc_pin_table);
#if SERIAL_PORT != 0
#define NUM_ANALOG_INPUTS 8
#else
#define NUM_ANALOG_INPUTS 6
#endif
// P0.6 thru P0.9 are for the onboard SD card
// P0.29 and P0.30 are for the USB port
#define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09, P0_29, P0_30

View File

@ -28,17 +28,17 @@
* Translation of routines & variables used by pinsDebug.h
*/
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
#define pwm_details(pin) pin = pin // do nothing // print PWM details
#define pwm_status(pin) false //Print a pin's PWM status. Return true if it's currently a PWM pin.
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
#define digitalRead_mod(p) digitalRead(p)
#define digitalPinToPort_DEBUG(p) 0
#define digitalPinToBitMask_DEBUG(pin) 0
#define PRINT_PORT(p) SERIAL_ECHO_SP(10);
#define PRINT_PORT(p)
#define GET_ARRAY_PIN(p) pin_array[p].pin
#define NAME_FORMAT(p) PSTR("%-##p##s")
#define PRINT_ARRAY_NAME(x) do {sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer);} while (0)
#define PRINT_PIN(p) do {sprintf_P(buffer, PSTR("%d.%02d"), LPC1768_PIN_PORT(p), LPC1768_PIN_PIN(p)); SERIAL_ECHO(buffer);} while (0)
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
// active ADC function/mode/code values for PINSEL registers
constexpr int8_t ADC_pin_mode(pin_t pin) {