Welp I’ve done a bit. I made exercise.h. This header file contains the exercise and exercise point types, used to define an exercise and a location and time at a point to that exercise. Each point which contains a location and time is stored in a linked list array. I have chosen to use a linked list array so that I don’t have to set predefined limits on the size of each array, the only downside being I have to manage all the memory manually. I also added the function to add to the linked list in the exercise. To reduce time complexity from O(n) to O(1) I have changed the way the linked list works adding in a last pointer. This points to the last object in the linked list and is very useful for adding to the linked list as we don’t need to cycle through every object in said list. Although, I have included a fallback in case exercise->last is null meaning the last variable isn’t set which is O(n). I have also made the code to add points to the linked list every time the GPS detects your location changing (eg. around 15hz). I have also added the code to setup I2C for the PCF extension board, and written the code to read and write to and from it. Now the reason I need a PCF extension board was because of a slight oversight when designing the PCB. I forgot to add GPIO onto the PCB for buttons, so I needed to find a solution.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.