gemu2015 / Sonoff-Tasmota

Tasmota Fork TCS34725,PN532_i2,ccc1101 Moritz support,m5stack 4,7 epaper, hotplug drivers
GNU General Public License v3.0
24 stars 19 forks source link

Enabled SPS30 driver with Tasmota32 generates linker error #27

Closed Jason2866 closed 3 years ago

Jason2866 commented 3 years ago

PROBLEM DESCRIPTION

Enabling driver SPS30 driver with Tasmota32 generates linker error

Linking .pio/build/tasmota32/firmware.elf
.pio/build/tasmota32/src/tasmota.ino.cpp.o:(.literal._Z14sps30_get_datatPhh+0x4): undefined reference to `twi_readFrom(unsigned char, unsigned char*, unsigned int, unsigned char)'
.pio/build/tasmota32/src/tasmota.ino.cpp.o: In function `sps30_get_data(unsigned short, unsigned char*, unsigned char)':
/workspace/Tasmota/tasmota/xdrv_04_light.ino:320: undefined reference to `twi_readFrom(unsigned char, unsigned char*, unsigned int, unsigned char)'
collect2: error: ld returned 1 exit status
*** [.pio/build/tasmota32/firmware.elf] Error 1

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:

Rules output here:

- [ ] Provide the output of this command: `Status 0`:

STATUS 0 output here:

- [ ] Provide the output of the Console log output when you experience your issue; if applicable:
  _(Please use_ `weblog 4` _for more debug information)_

Console output here:


### TO REPRODUCE
_Steps to reproduce the behavior:_
Enable SPS30 sensor in Tasmota32 build

### EXPECTED BEHAVIOUR
Compile and Linking successful

### SCREENSHOTS
_If applicable, add screenshots to help explain your problem._

### ADDITIONAL CONTEXT
Maybe this code change solves. Suggestion from @staars He can not test (no SPS30 sensor)

ifdef ESP8266

twi_readFrom(SPS30_ADDR,twi_buff,dlen,1);

else

Wire.readTransmission(SPS30_ADDR,twi_buff,dlen,1, NULL);

endif



**(Please, remember to close the issue when the problem has been addressed)**
gemu2015 commented 3 years ago

@Jason2866

My SPS30 is glued together with an ESP8266 and i do not want to tear it down.

But the code change above should definitely work!