Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IntegerDivideByZero error when no chip detected Issue #311 #312

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/bm1397/bm1366.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
4 changes: 3 additions & 1 deletion components/bm1397/bm1368.c
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down