Skip to content

stm32/boards/make-pins.py: Fix H7 ADC generation. #12867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2023

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 <jim.mussared@gmail.com>
@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