emanuelen5 / kitchen-timer

0 stars 0 forks source link

Application library #49

Closed nperozzi closed 2 months ago

nperozzi commented 3 months ago

This is my second shot to the Application library. I don´t think it is looking great but I think I need some feedback to see what is wrong and how to approach it.

How is it structured?

I hope this is somewhat understandable. I am looking forward to hearing your comments. 😄

emanuelen5 commented 3 months ago

^ I rebased the changes to fix the merge conflict, and make the diff easier to review

nperozzi commented 2 months ago

I had to move the led_counter() functions from the state machine layer to the application layer because the LEDs refresh every time any state machine refreshes (5 times per second). This made me think that I should remove all the debugging printf comments to the application layer. @emanuelen5, what do you think?

nperozzi commented 2 months ago

I still need to pass all the tests.

emanuelen5 commented 2 months ago

I still need to pass all the tests.

I can see that the tests fail to compile. It looks like this is due to the library resolver pulling in AVR libraries when compiling the library lib/platform-independent.

To be honest, I've cheated a bit - the state machine isn't truly platform independent since it's using the UART functions (which use the serial port on the AVR) and the debug LEDs (which use the GPIO on the AVR). But I've worked around this in the following way previously :) :

  1. In the application.cpp file, remove these two lines

https://github.com/emanuelen5/kitchen-timer/blob/68334ff1847745c63f99f073b05905e078b049e9/lib/platform-independent/application.cpp#L2-L3

  1. and then add the following declarations to the file:

https://github.com/emanuelen5/kitchen-timer/blob/07a3ae504d34a1143a7160354833772fcac7eea9/lib/platform-independent/state-machine.cpp#L5-L7

That will stop the library resolver from pulling in the AVR-files when compiling the platform-independent library.