#include <stdint.h>
#include <stdio.h>
#include "pmfeatures.h"
#include "sli.h"
#include "mem.h"
#include "obj.h"
#include "seq.h"
#include "tuple.h"
#include "strobj.h"
#include "heap.h"
#include "int.h"
#include "seglist.h"
#include "list.h"
#include "dict.h"
#include "codeobj.h"
#include "func.h"
#include "module.h"
#include "frame.h"
#include "interp.h"
#include "img.h"
#include "global.h"
#include "class.h"
#include "thread.h"
#include "float.h"
#include "plat.h"
Go to the source code of this file.
Defines | |
#define | PM_RELEASE 8 |
#define | C_NULL 0 |
#define | C_FALSE 0 |
#define | C_TRUE (!C_FALSE) |
#define | C_SAME (int8_t)0 |
#define | C_DIFFER (int8_t)-1 |
#define | INLINE __inline__ |
#define | PM_RAISE(retexn, exn) retexn = (exn) |
#define | PM_BREAK_IF_ERROR(retval) if((retval) != PM_RET_OK)break |
#define | PM_RETURN_IF_ERROR(retval) |
#define | PM_REPORT_IF_ERROR(retval) |
#define | C_ASSERT(boolexpr) |
#define | VERBOSITY_LOW 1 |
#define | VERBOSITY_MEDIUM 2 |
#define | VERBOSITY_HIGH 3 |
#define | C_DEBUG_PRINT(...) |
Typedefs | |
typedef enum PmReturn_e | PmReturn_t |
Enumerations | |
enum | PmReturn_e { PM_RET_OK = 0, PM_RET_NO = 0xFF, PM_RET_ERR = 0xFE, PM_RET_STUB = 0xFD, PM_RET_ASSERT_FAIL = 0xFC, PM_RET_FRAME_SWITCH = 0xFB, PM_RET_EX = 0xE0, PM_RET_EX_EXIT = 0xE1, PM_RET_EX_IO = 0xE2, PM_RET_EX_ZDIV = 0xE3, PM_RET_EX_ASSRT = 0xE4, PM_RET_EX_ATTR = 0xE5, PM_RET_EX_IMPRT = 0xE6, PM_RET_EX_INDX = 0xE7, PM_RET_EX_KEY = 0xE8, PM_RET_EX_MEM = 0xE9, PM_RET_EX_NAME = 0xEA, PM_RET_EX_SYNTAX = 0xEB, PM_RET_EX_SYS = 0xEC, PM_RET_EX_TYPE = 0xED, PM_RET_EX_VAL = 0xEE, PM_RET_EX_STOP = 0xEF, PM_RET_EX_WARN = 0xF0 } |
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 |
Include things that are needed by nearly everything.
#define C_ASSERT | ( | boolexpr | ) |
Assert statements are removed from production code
#define C_DIFFER (int8_t)-1 |
Comparison result is that items differ
#define C_FALSE 0 |
false for C code
#define C_NULL 0 |
null for C code
#define C_SAME (int8_t)0 |
Comparison result is that items are the same
#define C_TRUE (!C_FALSE) |
true for C code
#define INLINE __inline__ |
PORT inline for C code
#define PM_BREAK_IF_ERROR | ( | retval | ) | if((retval) != PM_RET_OK)break |
if retval is not OK, break from the block
#define PM_RAISE | ( | retexn, | |||
exn | ) | retexn = (exn) |
Returns an exception error code and stores debug data
This macro must be used as an rval statement. That is, it must be used after an assignment such as "retval = " or a return statement
#define PM_RELEASE 8 |
Value indicating the release of PyMite
This value should be incremented for every public release. It helps locate a defect when used in conjunction with a fileID and line number.
#define PM_REPORT_IF_ERROR | ( | retval | ) |
Value:
if ((retval) != PM_RET_OK) \ plat_reportError(retval)
#define PM_RETURN_IF_ERROR | ( | retval | ) |
Value:
if((retval) != PM_RET_OK) \ return (retval)
#define VERBOSITY_HIGH 3 |
Use as the first argument to C_DEBUG_PRINT for high volume messages
#define VERBOSITY_LOW 1 |
Use as the first argument to C_DEBUG_PRINT for low volume messages
#define VERBOSITY_MEDIUM 2 |
Use as the first argument to C_DEBUG_PRINT for medium volume messages
typedef enum PmReturn_e PmReturn_t |
Return values for system functions to report status, errors, exceptions, etc. Normally, functions which use these values should propagate the same return value up the call tree to the interpreter.
enum PmReturn_e |
Return values for system functions to report status, errors, exceptions, etc. Normally, functions which use these values should propagate the same return value up the call tree to the interpreter.
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. |