I am developing a MIOS32 app and I’ve run into a bit of a problem.
When I try to use MIOS32_BOARD_J5_PinGet() it always returns zero, however if I check the same pin in the APP_AIN_NotifyChange() hook the hook does get called with changes of input and the value provided to the hook is correct.
Attached is a minimumal app to demonstrate the problem. If you compile and run this app as is then you should see just “0000” in the top left of the LCD screen which does not change in response to analogue values at pin 0.
If you look at APP_AIN_NotifyChange() in app.c you will see there is two versions of the line that prints the value of pin 0 to the LCD. One line simply prints “pin_value” (this one is commented out) and the other line re-fetches the value using MIOS32_BOARD_J5_PinGet(0). When “pin_value” is printed, the correct value is shown (changing value between 0 and 4096), but when the value from MIOS32_BOARD_J5_PinGet() is printed, it always comes out as 0000.
From my reading of things, both of these lines should produce exactly the same result.
What am I doing wrong?
[j5_test.zip](< base_url >/applications/core/interface/file/attachment.php?id=7172)