Open avsa242 opened 4 months ago
This actually works, if the tmf8828_image.c
file is modified slightly:
PROGMEM
keyword from the array definition.#include
lines.The image therein can then be used by declaring the .c file as an object and calling the driver's set_fw_image()
with a pointer to the array and the size const provided (or specified manually).
e.g.,:
obj
sensor: "sensor.range.tmf8828.spin"
fw_img: "tmf8828_image.c"
pub main()
sensor.set_fw_image(@fw_img.tmf8828_image, fw_img.tmf8828_image_length)
It seems this doesn't work when building as bytecode. For some reason the address of the firmware image is returned as 0.
Since FlexSpin allows mixing of spin and C, check to see if the
.c
image file can be declared as an external object. If it doesn't have any dependencies or other reasons it won't work technically, it'd be a nice feature as it wouldn't be necessary to translate thetmf8828_image.c
to the equivalent spin, and it'd be easier for someone to just go to ams' repository and download it.