Change ADNS9800 and PMW33XX SROM uploads to opt in. (#24001)

Make SROM upload optional
This commit is contained in:
Dasky 2024-06-27 05:10:13 +01:00 committed by GitHub
parent 276ecd4693
commit a7aa58cc81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View File

@ -115,6 +115,7 @@ void adns9800_init(void) {
adns9800_read(REG_Delta_Y_L); adns9800_read(REG_Delta_Y_L);
adns9800_read(REG_Delta_Y_H); adns9800_read(REG_Delta_Y_H);
#ifdef ADNS9800_UPLOAD_SROM
// upload firmware // upload firmware
// 3k firmware mode // 3k firmware mode
@ -145,6 +146,16 @@ void adns9800_init(void) {
spi_stop(); spi_stop();
wait_ms(10); wait_ms(10);
#else
// write reset value to REG_Configuration_IV
adns9800_write(REG_Configuration_IV, 0x0);
// write reset value to REG_SROM_Enable
adns9800_write(REG_SROM_Enable, 0x0);
// wait a frame
wait_ms(10);
#endif
// enable laser // enable laser
uint8_t laser_ctrl0 = adns9800_read(REG_LASER_CTRL0); uint8_t laser_ctrl0 = adns9800_read(REG_LASER_CTRL0);

View File

@ -154,10 +154,12 @@ bool pmw33xx_init(uint8_t sensor) {
pmw33xx_read(sensor, REG_Delta_Y_L); pmw33xx_read(sensor, REG_Delta_Y_L);
pmw33xx_read(sensor, REG_Delta_Y_H); pmw33xx_read(sensor, REG_Delta_Y_H);
#ifdef PMW33XX_UPLOAD_SROM
if (!pmw33xx_upload_firmware(sensor)) { if (!pmw33xx_upload_firmware(sensor)) {
pd_dprintf("PMW33XX (%d): firmware upload failed!\n", sensor); pd_dprintf("PMW33XX (%d): firmware upload failed!\n", sensor);
return false; return false;
} }
#endif
spi_stop(); spi_stop();