lhr-solar / BPS

Battery Protection System Code
MIT License
4 stars 2 forks source link

Makefile print better #575

Closed connorl309 closed 1 year ago

connorl309 commented 1 year ago

Quality Assurance Checklist

To make reviews more efficient, please make sure the software feature meets the following standards and check everything off that meets the quality check. Once everything has been checked, the assigned reviewers will begin the review process. Edit this description to check off the list.

There are exceptions with all guidelines. As long as your decisions are justified, then you are good! Contact the reviewers or the leads about any exceptions.

Requirements

Things to Consider

manthanand commented 1 year ago

can you post a ss of the output when you make?

connorl309 commented 1 year ago

can you post a ss of the output when you make?

image

Defines are specified as "DEFINES==VALUE/=VALUE...." Forward slash is the separator because Make functions cannot split on commas

manthanand commented 1 year ago

I don't think this looks pretty. Also, there shouldn't be errors in the code?

manthanand commented 1 year ago

Ig I wasn't too clear in the issue ticket. Could you make it so it prints out the values of all the #defines in the config file every time something is made?

connorl309 commented 1 year ago

image There is no possible way in GCC to evaluate our ternary macros, so they will be printed as such. Works with custom defines and still shows errors if you have invalid value combos such that compilation for other files dependent on the macros fails.

manthanand commented 1 year ago

tis a shame. ok

manthanand commented 1 year ago

I googled something, could you try this? XSTR((int)NUM_MINIONS) for all the defines?

connorl309 commented 1 year ago

I googled something, could you try this? XSTR((int)NUM_MINIONS) for all the defines?

It just prefixes all the prints with "(int)" image

e: ternaries are only evaluated at runtime apparently so I don't think we can precalculate the values unless we do a bunch more wacky stuff with the preprocessor

manthanand commented 1 year ago

Its mad stoopid if the ternaries are evaluated in runtime and not compile time.

connorl309 commented 1 year ago

New changes pushed. should be finalized

connorl309 commented 1 year ago

Ok so tests fail because some fixes from Champer's sim workflow branch aren't in here yet so some compilation explodes bc of array indices