Skip to content

For the four missing functions from eadk.h, try to bypass this limitation by using SVC calls? #5

Closed
@Naereen

Description

@Naereen

By some C code like this:

// See: https://yaya-cout.github.io/Nwagyu/reference/apps/syscalls.html
// FIXME: experimental use of svcall.h
#include "svcall.h"

void SVC_ATTRIBUTES setBlinking(uint16_t periodInMilliseconds,  float dutyCycle) {
  SVC_RETURNING_VOID(SVC_LED_SET_BLINKING)
}

and then

  // SVC call to SVC_LED_SET_BLINKING = 36
  // See: https://github.com/numworks/epsilon/blob/9072ab80a16d4c15222699f73896282a65eecd54/ion/src/device/shared/drivers/svcall.h#L82
  // asm("svc 36");

  // // See: https://github.com/numworks/epsilon/blob/9072ab80a16d4c15222699f73896282a65eecd54/ion/src/shared/exam_mode.cpp#L14
  // const uint16_t blinkPeriod = 1000;  // in ms
  // const float blinkDutyCycle = 0.1f;
  // setBlinking(blinkPeriod, blinkDutyCycle);

we could maybe simulate the missing functions from eadk.h:

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

See <https://yaya-cout.github.io/Nwagyu/reference/apps/syscalls.html> for more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions