Skip to content

Conversation

@jimmo
Copy link
Member

@jimmo jimmo commented Nov 3, 2023

  • Only emit ADC table entries for pins that aren't cpu-hidden (i.e. ignore X,-Y rows).
  • Only use the P channels on H7.

cc @iabdalkader


This now emits (on ARDUINO_PORTENTA_H7):

const machine_pin_obj_t pin_A0_obj = PIN(A, 0, pin_A0_af, PIN_ADC1, 16);
const machine_pin_obj_t pin_A1_obj = PIN(A, 1, pin_A1_af, PIN_ADC1, 17);

...

const machine_pin_obj_t * const pin_adc1[20] = {
    [16] = &pin_A0_obj,
    [17] = &pin_A1_obj,
    [18] = &pin_A4_obj,
    [12] = &pin_C2_obj,
    [13] = &pin_C3_obj,
    [6] = &pin_F12_obj,
};

const machine_pin_obj_t * const pin_adc2[20] = {
    [18] = &pin_A4_obj,
    [12] = &pin_C2_obj,
    [13] = &pin_C3_obj,
    [2] = &pin_F13_obj,
};

const machine_pin_obj_t * const pin_adc3[17] = {
    [12] = &pin_C2_obj,
};

Fixes are:
- Only emit ADC table entries for pins that aren't cpu-hidden
  (i.e. ignore `X,-Y` rows).
- Only use the P channels on H7.

Signed-off-by: Jim Mussared <[email protected]>
@dpgeorge dpgeorge merged commit 8414228 into micropython:master Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants