Fix pmw33xx sensor initialisation (#25777)

This commit is contained in:
Joel Challis
2025-11-08 20:49:15 +00:00
committed by GitHub
parent 22b213e191
commit 00eebfb575
2 changed files with 2 additions and 1 deletions

View File

@@ -108,7 +108,7 @@ __attribute__((weak)) bool pmw33xx_check_signature(uint8_t sensor) {
pmw33xx_read(sensor, REG_Inverse_Product_ID),
};
return memcmp(pmw33xx_firmware_signature, signature_dump, sizeof(signature_dump)) == 0;
return memcmp_P(signature_dump, pmw33xx_firmware_signature, sizeof(signature_dump)) == 0;
}
bool pmw33xx_upload_firmware(uint8_t sensor) {

View File

@@ -7,6 +7,7 @@
# define PROGMEM
# define PSTR(x) x
# define PGM_P const char*
# define memcmp_P(s1, s2, n) memcmp(s1, s2, n)
# define memcpy_P(dest, src, n) memcpy(dest, src, n)
# define pgm_read_byte(address_short) *((uint8_t*)(address_short))
# define pgm_read_word(address_short) *((uint16_t*)(address_short))