1
0
Fork 0

[Bug][Core] Fix optical sensor firmware upload (#15919)

This commit is contained in:
Drashna Jael're 2022-01-20 09:23:16 -08:00 committed by GitHub
parent 24324378a8
commit 6ebb44f17e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 28 deletions

View file

@ -210,14 +210,12 @@ void pmw3389_upload_firmware(void) {
spi_write(REG_SROM_Load_Burst | 0x80);
wait_us(15);
// legacy only for PMW3389 spi_transmit failed to load firmware
unsigned char c;
for (int i = 0; i < FIRMWARE_LENGTH; i++) {
c = (unsigned char)pgm_read_byte(firmware_data + i);
spi_write(c);
for (uint16_t i = 0; i < FIRMWARE_LENGTH; i++) {
spi_write(pgm_read_byte(firmware_data + i));
#ifndef PMW3389_FIRMWARE_UPLOAD_FAST
wait_us(15);
#endif
}
wait_us(200);
pmw3389_read(REG_SROM_ID);