diff --git a/components/bm1397/bm1366.c b/components/bm1397/bm1366.c index a2186c381..07aed1d8a 100644 --- a/components/bm1397/bm1366.c +++ b/components/bm1397/bm1366.c @@ -436,7 +436,9 @@ static uint8_t _send_init(uint64_t frequency, uint16_t asic_count) // _send_simple(init6, 7); // split the chip address space evenly - uint8_t address_interval = (uint8_t) (256 / chip_counter); + if (chip_counter != 0) { + uint8_t address_interval = (uint8_t) (256 / chip_counter); + } for (uint8_t i = 0; i < chip_counter; i++) { _set_chip_address(i * address_interval); // unsigned char init7[7] = { 0x55, 0xAA, 0x40, 0x05, 0x00, 0x00, 0x1C }; diff --git a/components/bm1397/bm1368.c b/components/bm1397/bm1368.c index 6ee5ce9b5..180b75162 100644 --- a/components/bm1397/bm1368.c +++ b/components/bm1397/bm1368.c @@ -313,7 +313,9 @@ static uint8_t _send_init(uint64_t frequency, uint16_t asic_count) // _send_simple(init7, 7); // split the chip address space evenly - uint8_t address_interval = (uint8_t) (256 / chip_counter); + if (chip_counter != 0) { + uint8_t address_interval = (uint8_t) (256 / chip_counter); + } for (uint8_t i = 0; i < chip_counter; i++) { _set_chip_address(i * address_interval); // unsigned char init8[7] = {0x55, 0xAA, 0x40, 0x05, 0x00, 0x00, 0x1C};