Skip to content

Commit fc2a952

Browse files
committed
☔ strict the option only for m5stick
1 parent 8d1d4bd commit fc2a952

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/modules/rfid/PN532.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,22 @@ PN532::PN532(CONNECTION_TYPE connection_type) {
2020
_connection_type = connection_type;
2121
_use_i2c = (connection_type == I2C || connection_type == I2C_SPI);
2222
if (connection_type == CONNECTION_TYPE::I2C) nfc.setInterface(GROVE_SDA, GROVE_SCL);
23+
#ifdef M5STICK
2324
else if (connection_type == CONNECTION_TYPE::I2C_SPI) nfc.setInterface(GPIO_NUM_26, GPIO_NUM_25);
25+
#endif
2426
else nfc.setInterface(SPI_SCK_PIN, SPI_MISO_PIN, SPI_MOSI_PIN, SPI_SS_PIN);
2527
}
2628

2729
bool PN532::begin() {
30+
#ifdef M5STICK
2831
if (_connection_type == CONNECTION_TYPE::I2C_SPI) {
2932
Wire.begin(GPIO_NUM_26, GPIO_NUM_25);
3033
} else if (_connection_type == CONNECTION_TYPE::I2C) {
3134
Wire.begin(GROVE_SDA, GROVE_SCL);
3235
}
36+
#else
37+
Wire.begin(GROVE_SDA, GROVE_SCL);
38+
#endif
3339

3440
bool i2c_check = true;
3541
if (_use_i2c) {

src/modules/rfid/tag_o_matic.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ TagOMatic::~TagOMatic() {
4141
void TagOMatic::set_rfid_module() {
4242
switch (bruceConfig.rfidModule) {
4343
case PN532_I2C_MODULE: _rfid = new PN532(PN532::CONNECTION_TYPE::I2C); break;
44+
#ifdef M5STICK
4445
case PN532_I2C_SPI_MODULE: _rfid = new PN532(PN532::CONNECTION_TYPE::I2C_SPI); break;
46+
#endif
4547
case PN532_SPI_MODULE: _rfid = new PN532(PN532::CONNECTION_TYPE::SPI); break;
4648
case RC522_SPI_MODULE: _rfid = new RFID2(false); break;
4749
case M5_RFID2_MODULE:

0 commit comments

Comments
 (0)