2017-06-29 16:47:26 +02:00
|
|
|
#ifndef __PXT_H
|
|
|
|
#define __PXT_H
|
|
|
|
|
|
|
|
#include "pxtbase.h"
|
|
|
|
|
2017-12-13 16:28:52 +01:00
|
|
|
void *xmalloc(size_t sz);
|
|
|
|
|
2017-07-05 02:17:26 +02:00
|
|
|
namespace pxt {
|
|
|
|
void raiseEvent(int id, int event);
|
2017-07-07 12:44:34 +02:00
|
|
|
int allocateNotifyEvent();
|
2017-07-05 02:17:26 +02:00
|
|
|
void sleep_core_us(uint64_t us);
|
2017-10-30 20:18:01 +01:00
|
|
|
void startUser();
|
|
|
|
void stopUser();
|
2017-07-05 02:17:26 +02:00
|
|
|
|
|
|
|
class Button;
|
|
|
|
typedef Button *Button_;
|
|
|
|
|
2017-07-05 19:35:05 +02:00
|
|
|
extern "C" void target_init();
|
2017-07-07 19:26:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
class MMap : public RefObject {
|
|
|
|
public:
|
|
|
|
int length;
|
|
|
|
int fd;
|
|
|
|
uint8_t *data;
|
|
|
|
|
|
|
|
MMap();
|
|
|
|
void destroy();
|
|
|
|
void print();
|
|
|
|
};
|
|
|
|
|
2017-07-15 22:32:10 +02:00
|
|
|
extern volatile bool paniced;
|
2017-07-07 19:26:49 +02:00
|
|
|
|
2017-10-30 18:25:58 +01:00
|
|
|
// Buffer, Sound, and Image share representation.
|
2017-10-30 14:28:01 +01:00
|
|
|
typedef Buffer Image;
|
2017-10-30 18:25:58 +01:00
|
|
|
typedef Buffer Sound;
|
2017-10-30 14:04:12 +01:00
|
|
|
|
2017-07-05 02:17:26 +02:00
|
|
|
}
|
|
|
|
|
2017-07-07 12:44:34 +02:00
|
|
|
#define DEVICE_EVT_ANY 0
|
|
|
|
#define DEVICE_ID_NOTIFY 10000
|
|
|
|
#define DEVICE_ID_NOTIFY_ONE 10001
|
|
|
|
|
2017-06-29 16:47:26 +02:00
|
|
|
#endif
|