2018-06-18 20:58:32 +03:00
|
|
|
#include "pxt.h"
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
namespace pxt {
|
|
|
|
|
|
|
|
static void initRandomSeed() {
|
|
|
|
int seed = 0xC0DA1;
|
|
|
|
int fd = open("/dev/urandom", O_RDONLY);
|
|
|
|
read(fd, &seed, sizeof(seed));
|
|
|
|
close(fd);
|
|
|
|
seedRandom(seed);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sendSerial(const char *data, int len) {
|
|
|
|
/*
|
|
|
|
if (!serial) {
|
|
|
|
serial = new codal::_mbed::Serial(USBTX, NC);
|
|
|
|
serial->baud(9600);
|
|
|
|
}
|
|
|
|
serial->send((uint8_t*)data, len);
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" void drawPanic(int code)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" void target_init()
|
|
|
|
{
|
|
|
|
initRandomSeed();
|
|
|
|
}
|
|
|
|
|
2018-12-15 00:38:56 +03:00
|
|
|
void updateScreen(Image_ img);
|
2018-06-18 20:58:32 +03:00
|
|
|
|
2018-12-15 00:38:56 +03:00
|
|
|
void screen_init() {
|
|
|
|
updateScreen(NULL);
|
2018-06-18 20:58:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|