Skip to content
Snippets Groups Projects
Commit 9d133929 authored by schneider's avatar schneider
Browse files

fix(pycardium): fixes to support MicroPython v1.13

parent 53865578
Branches
No related tags found
1 merge request!446Initial MicroPython BLE support (GATTS)
......@@ -18,12 +18,12 @@ gcc -E -DNO_QSTR -I"$SOURCE_DIR/micropython" -I"$PROJECT_SRC" -I"$OUTPUT_DIR" "$
rm -rf "$OUTPUT_DIR/qstr"
# Generate qstr.split
"$PYTHON" "$SOURCE_DIR/micropython/py/makeqstrdefs.py" split \
"$OUTPUT_DIR/qstr.i.last" "$OUTPUT_DIR/qstr" "$OUTPUT_DIR/qstrdefs.collected.h" >/dev/null
"$PYTHON" "$SOURCE_DIR/micropython/py/makeqstrdefs.py" split qstr\
"$OUTPUT_DIR/qstr.i.last" "$OUTPUT_DIR/qstr" "$OUTPUT_DIR/qstrdefs.collected.h"
# Generate qstr.collected.h
"$PYTHON" "$SOURCE_DIR/micropython/py/makeqstrdefs.py" cat \
"$OUTPUT_DIR/qstr.i.last" "$OUTPUT_DIR/qstr" "$OUTPUT_DIR/qstrdefs.collected.h" >/dev/null
"$PYTHON" "$SOURCE_DIR/micropython/py/makeqstrdefs.py" cat qstr\
"$OUTPUT_DIR/qstr.i.last" "$OUTPUT_DIR/qstr" "$OUTPUT_DIR/qstrdefs.collected.h"
# Preprocess Header ... I did not come up with this, this is code copied from
# the official make file. Seriously.
......
......@@ -111,11 +111,11 @@ file_obj_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg, int *errcode)
STATIC const mp_arg_t file_open_args[] = {
{ MP_QSTR_file,
MP_ARG_OBJ | MP_ARG_REQUIRED,
{ .u_rom_obj = MP_ROM_PTR(&mp_const_none_obj) } },
{ .u_rom_obj = mp_const_none } },
{ MP_QSTR_mode, MP_ARG_OBJ, { .u_obj = MP_OBJ_NEW_QSTR(MP_QSTR_r) } },
{ MP_QSTR_encoding,
MP_ARG_OBJ | MP_ARG_KW_ONLY,
{ .u_rom_obj = MP_ROM_PTR(&mp_const_none_obj) } },
{ .u_rom_obj = mp_const_none } },
};
#define FILE_OPEN_NUM_ARGS MP_ARRAY_SIZE(file_open_args)
......
......@@ -30,11 +30,26 @@ bool mp_bluetooth_is_enabled(void)
return false;
}
bool mp_bluetooth_is_active(void)
{
return false;
}
// Gets the MAC addr of this device in big-endian format.
void mp_bluetooth_get_device_addr(uint8_t *addr)
{
}
size_t mp_bluetooth_gap_get_device_name(const uint8_t **buf)
{
return 0;
}
int mp_bluetooth_gap_set_device_name(const uint8_t *buf, size_t len)
{
return 0;
}
// Start advertisement. Will re-start advertisement when already enabled.
// Returns errno on failure.
int mp_bluetooth_gap_advertise_start(
......@@ -108,7 +123,7 @@ int mp_bluetooth_gatts_notify_send(
uint16_t conn_handle,
uint16_t value_handle,
const uint8_t *value,
size_t *value_len
size_t value_len
) {
raise();
return 0;
......
......@@ -232,7 +232,7 @@ static void systick_delay_sleep(uint32_t us)
* One example of this happeing is the KeyboardInterrupt
* (CTRL+C) which will abort the running code and exit to REPL.
*/
mp_handle_pending();
mp_handle_pending(true);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment