You are reading a single comment by @user156811 and its replies. Click here to read the full conversation.
  • Thoughts on just jswrap_bangle_hardware.c

    So i think that would be a huge step forward. My biggest complaint was not knowing where to edit the code if i wanted to add something. So if you split out the each piece of hardware out then it make it easy to know where to go if you want to add a IMU or something. Which is huge!

    So if you don't like the idea of WEAK functions, but do like the idea of splitting the files out. We could just have a bangle_HARDWARE_impl.h file and no *.c file. So then every HARDWARE_impl.c file has to include every function. That would accomplish the same thing. I think i remember us talking about something like this before.

    So i personally like the idea of splitting out the drivers into there own files because then it's easy to find all the code thats specific to that given driver, but also because it hides some of the weird parts of other drivers. For me one of the weird things is seeing all the things special to just the BANGLE 1. From a hardware perspective it kind of just does things different then most of the other watches. So moving all there hardware specific stuff to a separate file makes the rest of the code easier to read.

    Final thoughts
    So i think moving all the code into specific JSwrap files is a great step forward. Its exactly what i did when making all my changes.

    I2C calls
    I2C array calls. I don't know how much flash it saves if any, but i do think it reads better.

    Ex:

    • Write(IMU, IntI2cCallsAccel); //pseudocode code example

    It's kind of self documenting code.
    @Gordon

About

Avatar for user156811 @user156811 started