Skip to content
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

Hardcoded HAL port definitions #103

Open
RogerQi opened this issue Oct 6, 2022 · 0 comments
Open

Hardcoded HAL port definitions #103

RogerQi opened this issue Oct 6, 2022 · 0 comments
Labels
good first issue Good for newcomers todo Things need to be done

Comments

@RogerQi
Copy link
Member

RogerQi commented Oct 6, 2022

The hardware pin definitions are hardcoded in almost all main.cc files in examples, which prevents the designed convientent function of switching board by changing one line in CMakeLists.txt

For example, in the gimbal example,

https://github.com/illini-robomaster/iRM_Embedded_2022/blob/main/examples/gimbal/main.cc#L51

  gimbal = new control::Gimbal(gimbal_init_data);

  dbus = new remote::DBUS(&huart1);
}

Here, the huart1 is the dbus port for the type A board only. For type-c board, the dbus port is

https://github.com/illini-robomaster/iRM_Embedded_2022/blob/main/examples/chassis/main.cc#L56

  chassis = new control::Chassis(chassis_data);

  dbus = new remote::DBUS(&huart3);
}

This should not be manually defined in every main.cc file. Instead, this port definition should be a DEFINE for one-liner change to switch to a differenty type of STM32 control board.

@RogerQi RogerQi added good first issue Good for newcomers todo Things need to be done labels Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers todo Things need to be done
Projects
None yet
Development

No branches or pull requests

1 participant