aboutsummaryrefslogtreecommitdiff
path: root/lib/pbdrv/drv
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pbdrv/drv')
-rw-r--r--lib/pbdrv/drv/arduino/mod.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/pbdrv/drv/arduino/mod.cpp b/lib/pbdrv/drv/arduino/mod.cpp
index 8766444..9130334 100644
--- a/lib/pbdrv/drv/arduino/mod.cpp
+++ b/lib/pbdrv/drv/arduino/mod.cpp
@@ -10,23 +10,22 @@
#include <timers.h>
#include <task.h>
-#include <stdlib.h>
-#include <stdint.h>
-
#include "../../pb.h"
#include "../../pb-mod.h"
+#include "../../pb-types.h"
#include "../../pb-buf.h"
+#include "../../pb-mem.h"
static void async_pb_i2c_recv(void * _msg, uint32_t _) {
pb_buf_t * msg = (pb_buf_t *) _msg;
pb_i2c_recv((uint8_t *) msg->data, msg->size);
pb_buf_free(msg);
- free(msg);
+ pb_free(msg);
}
static void recv_event(int bytes) {
- pb_buf_t * msg = (pb_buf_t *) malloc(sizeof(pb_buf_t));
- msg->data = (char *) malloc(bytes);
+ pb_buf_t * msg = (pb_buf_t *) pb_malloc(sizeof(pb_buf_t));
+ msg->data = (char *) pb_malloc(bytes);
msg->size = 0;
while (Wire.available())
msg->data[msg->size++] = Wire.read();