Skip to content

fix: correct include guard in TMC2240_HW_Abstraction.h, TMC2240.h, TMC2241_HW_Abstraction.h, TMC2241.h#82

Open
PetryaevAlex wants to merge 1 commit intoanalogdevicesinc:masterfrom
PetryaevAlex:fix/tmc2240_41-include-guard
Open

fix: correct include guard in TMC2240_HW_Abstraction.h, TMC2240.h, TMC2241_HW_Abstraction.h, TMC2241.h#82
PetryaevAlex wants to merge 1 commit intoanalogdevicesinc:masterfrom
PetryaevAlex:fix/tmc2240_41-include-guard

Conversation

@PetryaevAlex
Copy link

Problem:

TMC2240_HW_Abstraction.h uses the same include guard (TMC_IC_TMC2240_H_)
as TMC2240.h. And in TMC2240.h no include guard define. When both files are included, the preprocessor skips
HW_Abstraction entirely, causing compilation errors due to missing
register/field definitions.
Same with 2241 driver

Fix: Use unique TMC2240_HW_ABSTRACTION guard and added define to guard in TMC2240.h. Same situation with 2241 driver.

Same with 2241 driver

…C2241_HW_Abstraction.h, TMC2241.h. Include Guard was duplicating TMC_IC_TMC2240_H_ from TMC2240.h, causing the entire HW_Abstraction header to be skipped by the preprocessor when both files are included. Fixed to use unique TMC2240_HW_ABSTRACTION guard and added define to guard in TMC2240.h. Same situation with 2241 driver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant