Skip to content

Commit 0c7f92a

Browse files
authored
Fix DEBUG mode, include in zephyr primitives and typo (#289)
* Fix variable used in DEBUG mode being commented out to avoid warnings * Remove unnecessary include that causes issues * Fix pim_index typo * Updated comment next to variable * Also fix typo on the Arduino platform * Fix formatting * Fix missing type uint32_t error
1 parent c73a20b commit 0c7f92a

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

src/Primitives/arduino.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ int prim_index = 0;
153153
p->f_reverse = nullptr; \
154154
p->f_serialize_state = nullptr; \
155155
} else { \
156-
FATAL("pim_index out of bounds"); \
156+
FATAL("prim_index out of bounds"); \
157157
} \
158158
}
159159

src/Primitives/emulated.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ double sensor_emu = 0;
5050
p->f_reverse = nullptr; \
5151
p->f_serialize_state = nullptr; \
5252
} else { \
53-
FATAL("pim_index out of bounds"); \
53+
FATAL("prim_index out of bounds"); \
5454
} \
5555
}
5656

@@ -394,7 +394,7 @@ def_prim(chip_pin_mode, twoToNoneU32) {
394394
}
395395

396396
def_prim(chip_digital_write, twoToNoneU32) {
397-
debug("EMU: chip_digital_write(%u,%u) \n", arg1.uint32, arg0.uint32);
397+
printf("EMU: chip_digital_write(%u,%u) \n", arg1.uint32, arg0.uint32);
398398
pop_args(2);
399399
return true;
400400
}
@@ -462,7 +462,8 @@ def_prim(write_spi_bytes_16, twoToNoneU32) {
462462
def_prim(subscribe_interrupt, threeToNoneU32) {
463463
uint8_t pin = arg2.uint32; // GPIOPin
464464
uint8_t tidx = arg1.uint32; // Table Idx pointing to Callback function
465-
// uint8_t mode = arg0.uint32; // never used in emulator
465+
[[maybe_unused]] uint8_t mode =
466+
arg0.uint32; // Not used by emulator only printed
466467

467468
debug("EMU: subscribe_interrupt(%u, %u, %u) \n", pin, tidx, mode);
468469

src/Primitives/idf.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ double sensor_emu = 0;
5151
p->f_reverse = nullptr; \
5252
p->f_serialize_state = nullptr; \
5353
} else { \
54-
FATAL("pim_index out of bounds"); \
54+
FATAL("prim_index out of bounds"); \
5555
} \
5656
}
5757

src/Primitives/zephyr.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <sys/_stdint.h>
21
#ifndef ARDUINO
32

43
/**
@@ -54,7 +53,7 @@ double sensor_emu = 0;
5453
p->f_reverse = nullptr; \
5554
p->f_serialize_state = nullptr; \
5655
} else { \
57-
FATAL("pim_index out of bounds"); \
56+
FATAL("prim_index out of bounds"); \
5857
} \
5958
}
6059

tests/unit/shared/serialisation.h

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#pragma once
2+
#include <cstdint>
23
#include <iostream>
34

45
class Serialiser {

0 commit comments

Comments
 (0)