Seeed-Studio / Seeed_PM2_5_sensor_HM3301

MIT License
10 stars 7 forks source link

Fixed conflicting declaration #3

Closed freekode closed 4 years ago

freekode commented 4 years ago

Updated u32 declaration. Declaration only for AVR boards

Have such error, using it with ESP8266 board

In file included from .piolibdeps/test4/Grove - Laser PM2.5 Sensor HM3301_ID6306/Seeed_HM330X.cpp:32:0:
.piolibdeps/test4/Grove - Laser PM2.5 Sensor HM3301_ID6306/Seeed_HM330X.h:47:27: error: conflicting declaration 'typedef long unsigned int u32'
 typedef long unsigned int u32;
                           ^
In file included from /Users/.../.platformio/packages/framework-arduinoespressif8266/cores/esp8266/esp8266_peri.h:24:0,
                 from /Users/../.platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h:38,
                 from .piolibdeps/test4/Grove - Laser PM2.5 Sensor HM3301_ID6306/Seeed_HM330X.h:35,
                 from .piolibdeps/test4/Grove - Laser PM2.5 Sensor HM3301_ID6306/Seeed_HM330X.cpp:32:
/Users/.../.platformio/packages/framework-arduinoespressif8266/tools/sdk/include/c_types.h:51:29: error: 'u32' has a previous declaration as 'typedef unsigned int u32'
 typedef unsigned int        u32;

If you accept this pull request, could you also release new version.

Pillar1989 commented 4 years ago

I suggest you add an 8266 exclusive macro definition and consider other platforms, thanks

freekode commented 4 years ago

Good point, will fix it