Merge upstream changes from Marlin 2.1.2.2
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
|
||||
|
||||
#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)
|
||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
|
||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
||||
@@ -39,7 +38,6 @@
|
||||
#define VALID_PIN(pin) (pin >= 0 && pin < int8_t(NUMBER_PINS_TOTAL))
|
||||
#define DIGITAL_PIN_TO_ANALOG_PIN(p) int(p - analogInputToDigitalPin(0))
|
||||
#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && (P) <= analogInputToDigitalPin(13)) || ((P) >= analogInputToDigitalPin(14) && (P) <= analogInputToDigitalPin(17))
|
||||
#define pwm_status(pin) HAL_pwm_status(pin)
|
||||
#define GET_PINMODE(PIN) (VALID_PIN(pin) && IS_OUTPUT(pin))
|
||||
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
@@ -120,12 +118,12 @@ const struct pwm_pin_info_struct pwm_pin_info[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
void HAL_print_analog_pin(char buffer[], int8_t pin) {
|
||||
void print_analog_pin(char buffer[], const pin_t pin) {
|
||||
if (pin <= 23) sprintf_P(buffer, PSTR("(A%2d) "), int(pin - 14));
|
||||
else if (pin <= 41) sprintf_P(buffer, PSTR("(A%2d) "), int(pin - 24));
|
||||
}
|
||||
|
||||
void HAL_analog_pin_state(char buffer[], int8_t pin) {
|
||||
void analog_pin_state(char buffer[], const pin_t pin) {
|
||||
if (pin <= 23) sprintf_P(buffer, PSTR("Analog in =% 5d"), analogRead(pin - 14));
|
||||
else if (pin <= 41) sprintf_P(buffer, PSTR("Analog in =% 5d"), analogRead(pin - 24));
|
||||
}
|
||||
@@ -136,14 +134,14 @@ void HAL_analog_pin_state(char buffer[], int8_t pin) {
|
||||
* Print a pin's PWM status.
|
||||
* Return true if it's currently a PWM pin.
|
||||
*/
|
||||
bool HAL_pwm_status(int8_t pin) {
|
||||
bool pwm_status(const pin_t pin) {
|
||||
char buffer[20]; // for the sprintf statements
|
||||
const struct pwm_pin_info_struct *info;
|
||||
|
||||
if (pin >= CORE_NUM_DIGITAL) return 0;
|
||||
info = pwm_pin_info + pin;
|
||||
if (pin >= CORE_NUM_DIGITAL) return false;
|
||||
|
||||
if (info->type == 0) return 0;
|
||||
info = pwm_pin_info + pin;
|
||||
if (info->type == 0) return false;
|
||||
|
||||
/* TODO decode pwm value from timers */
|
||||
// for now just indicate if output is set as pwm
|
||||
@@ -151,4 +149,6 @@ bool HAL_pwm_status(int8_t pin) {
|
||||
return (*(portConfigRegister(pin)) == info->muxval);
|
||||
}
|
||||
|
||||
static void pwm_details(uint8_t pin) { /* TODO */ }
|
||||
void pwm_details(const pin_t) { /* TODO */ }
|
||||
|
||||
void print_port(const pin_t) {}
|
||||
|
Reference in New Issue
Block a user