Fix pmw33xx sensor initialisation (#25777)
This commit is contained in:
parent
22b213e191
commit
00eebfb575
2 changed files with 2 additions and 1 deletions
|
|
@ -108,7 +108,7 @@ __attribute__((weak)) bool pmw33xx_check_signature(uint8_t sensor) {
|
||||||
pmw33xx_read(sensor, REG_Inverse_Product_ID),
|
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) {
|
bool pmw33xx_upload_firmware(uint8_t sensor) {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
# define PROGMEM
|
# define PROGMEM
|
||||||
# define PSTR(x) x
|
# define PSTR(x) x
|
||||||
# define PGM_P const char*
|
# 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 memcpy_P(dest, src, n) memcpy(dest, src, n)
|
||||||
# define pgm_read_byte(address_short) *((uint8_t*)(address_short))
|
# define pgm_read_byte(address_short) *((uint8_t*)(address_short))
|
||||||
# define pgm_read_word(address_short) *((uint16_t*)(address_short))
|
# define pgm_read_word(address_short) *((uint16_t*)(address_short))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue