#include "pm.h"
Defines | |
#define | __FILE_ID__ 0x15 |
#define | PM_THREAD_TIMESLICE_MS 10 |
Functions | |
PmReturn_t | pm_init (PmMemSpace_t memspace, uint8_t *pusrimg) |
PmReturn_t | pm_run (uint8_t const *modstr) |
PmReturn_t | pm_vmPeriodic (uint16_t usecsSinceLastCall) |
Variables | |
volatile uint32_t | pm_timerMsTicks = 0 |
volatile uint32_t | pm_lastRescheduleTimestamp = 0 |
High-level functions to initialize and run PyMite
#define PM_THREAD_TIMESLICE_MS 10 |
Number of millisecond-ticks to pass before scheduler is run
PmReturn_t pm_init | ( | PmMemSpace_t | memspace, | |
uint8_t * | pusrimg | |||
) |
Initializes the PyMite virtual machine and indexes the user's application image. The VM heap and globals are reset. The argument, pusrimg, may be null for interactive sessions.
memspace | Memory space in which the user image is located | |
pusrimg | Address of the user image in the memory space |
PmReturn_t pm_run | ( | uint8_t const * | modstr | ) |
Executes the named module
modstr | Name of module to run |
PmReturn_t pm_vmPeriodic | ( | uint16_t | usecsSinceLastCall | ) |
Needs to be called periodically by the host program. For the desktop target, it is periodically called using a signal. For embedded targets, it needs to be called periodically. It should be called from a timer interrupt.
usecsSinceLastCall | Microseconds (not less than those) that passed since last call. This must be <64535. |