xmos / lib_device_control

xCORE device control library
Other
2 stars 16 forks source link

Add header files with shared code between host and device side #107

Closed lucianomartin closed 3 months ago

lucianomartin commented 3 months ago

This PR is a work in progress, and it is not ready to be merged.

This PR does the following:

Part of https://xmosjira.atlassian.net/browse/LSM-73

xross commented 3 months ago

Please add an entry in the changelog to describe changes :)

lucianomartin commented 3 months ago

Im wondering why the USE_I2C, USE_USE etc defines are required. They seem to remove unused code - which the compiler should handle? Unless I missed something.

If they are required they should be prepended with the lib name to avoid clashes (they are very generic name.

I don't think they are necessary, they were just used to make the code more clear. I will remove them nevertheless.

lucianomartin commented 3 months ago

Im wondering why the USE_I2C, USE_USE etc defines are required. They seem to remove unused code - which the compiler should handle? Unless I missed something. If they are required they should be prepended with the lib name to avoid clashes (they are very generic name.

I don't think they are necessary, they were just used to make the code more clear. I will remove them nevertheless.

@xross, these defines are already present in lib_device_control, for example here, so they are probably necessary for the host code.

  1. Should I rename the existing ones?
  2. Should I remove the new ones I added?
xross commented 3 months ago

Im wondering why the USE_I2C, USE_USE etc defines are required. They seem to remove unused code - which the compiler should handle? Unless I missed something. If they are required they should be prepended with the lib name to avoid clashes (they are very generic name.

I don't think they are necessary, they were just used to make the code more clear. I will remove them nevertheless.

@xross, these defines are already present in lib_device_control, for example here, so they are probably necessary for the host code.

  1. Should I rename the existing ones?
  2. Should I remove the new ones I added?

I'd be less concerned about clashes in host code - because we don't build up apps from lots of libs/modules. Making them match between host and device would likely be nice though.

As to if the device ones need removing - if they are just added to remove code id remove them - they just add complexity to the API.