pxt-ev3/libs/core/output.cpp

30 lines
451 B
C++
Raw Normal View History

2017-07-07 16:15:36 +02:00
#include "pxt.h"
#include "ev3.h"
namespace output {
/**
* Create a new zero-initialized buffer.
* @param size number of bytes in the buffer
*/
//%
Buffer createBuffer(int size) {
return mkBuffer(NULL, size);
}
extern "C" int WriteToPWMDevice(char *bytes, int num_bytes);
//%
void writePWM(Buffer buf) {
2017-07-10 15:16:31 +02:00
WriteToPWMDevice((char *)buf->data, buf->length);
}
}
namespace pxt {
void target_init() {
OutputInit();
SoundInit();
}
2017-07-07 16:15:36 +02:00
}