Skip to content

Commit

Permalink
Merge pull request #170 from ligenxxxx/fix-DM6300_detect()
Browse files Browse the repository at this point in the history
fix DM6300_detect()
  • Loading branch information
ligenxxxx authored Oct 31, 2023
2 parents 61da0a0 + d9bee63 commit 3f21fdf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/dm6300.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,9 +878,16 @@ CODE_SEG const dm6300_reg_value_t dm6300_init_regs[] = {

uint8_t DM6300_detect(void) {
uint32_t rdat = 0;
SPI_Write(0x3, 0xFF0, 0x18);
SPI_Read(0x3, 0x254, &rdat);
SPI_Write(0x6, 0xFF0, 0x18);
SPI_Read(0x6, 0xFF0, &rdat);

#ifdef _DEBUG_MODE
if (rdat != 0x18) {
debugf("\r\ndm6300 lost");
} else {
debugf("\r\ndm6300 alive");
}
#endif
return rdat != 0x18;
}

Expand Down

0 comments on commit 3f21fdf

Please sign in to comment.