numworks/epsilon

eadk.h declares four functions that are unavailable on the real hardware

Opened this issue · 0 comments

Hello there, dear @numworks team!

Describe the bug

When developing an external C application, which uses eadk.h to access the EADK library functions, I found out that these four functions are actually not implemented for the real hardware target:

bool eadk_battery_is_charging();
uint32_t eadk_battery_level();
float eadk_battery_voltage();
bool eadk_usb_is_plugged();

They are implemented in the simulator (see below), but not for the real hardware.

uint8_t eadk_battery_level() { return (uint8_t)Ion::Battery::level(); }

It is quite odd to let these function appear to the public users of your eadk.h header library, while no actual code exist behind (except for the simulator though).

Screenshots

I'll provide it below (screenshot of the NumWorks flashing website).

To Reproduce

Steps to reproduce the behavior:

  1. Write any C app that uses eadk.h header,
  2. Try to call any of the four missing functions,
  3. Compile your C app (it should work, they are in the header, so the compilation doesn't complain),
  4. Try to flash the resulting .nwa app on the NumWorks flashing website,
  5. Observe in the browser's developer view window (F12) the linker complaining about these functions being absent!

(note that eadk_timing_millis is also missing, except if -DDEVICE_PLATFORM is added to the Makefile when building)

Expected behavior

This could be fixed by:

  1. providing a real hardware implementation of the missing functions (if possible?);
  2. write at least a comment in eadk.h to mention that they will be missing, except on the simulator;
  3. remove them from the header eadk.h entirely?

Environment

  • Epsilon version: 23.2.5
  • The platform(s) on which the problem happens: actual device (my own calculator).

Thanks in advance.
I stay at your disposal if needed.
Kind regards,
Prof. Lilian Besson