cun
This commit is contained in:
@ -67,15 +67,18 @@ unsigned char GetReg(unsigned char address, unsigned char *reg_data){
|
||||
soft_iic_start(0);
|
||||
if (0 == soft_iic_tx_byte(0, FM176_WRITE_ADDR)) {
|
||||
soft_iic_stop(0);
|
||||
xlog("GetReg: 【write】 addr write error\n");
|
||||
return FAIL;
|
||||
}
|
||||
if (0 == soft_iic_tx_byte(0, address)) {
|
||||
soft_iic_stop(0);
|
||||
xlog("GetReg: 【reg】 addr write error\n");
|
||||
return FAIL;
|
||||
}
|
||||
soft_iic_start(0);
|
||||
if (0 == soft_iic_tx_byte(0, FM176_READ_ADDR)) {
|
||||
soft_iic_stop(0);
|
||||
xlog("GetReg: 【read】 addr read error\n");
|
||||
return FAIL;
|
||||
}
|
||||
*reg_data = soft_iic_rx_byte(0, 0);
|
||||
@ -96,14 +99,17 @@ unsigned char SetReg(unsigned char address, unsigned char reg_data){
|
||||
soft_iic_start(0);
|
||||
if (0 == soft_iic_tx_byte(0, FM176_WRITE_ADDR)) {
|
||||
soft_iic_stop(0);
|
||||
xlog("SetReg: 【write】 addr write error\n");
|
||||
return FAIL;
|
||||
}
|
||||
if (0 == soft_iic_tx_byte(0, address)) {
|
||||
soft_iic_stop(0);
|
||||
xlog("SetReg: 【reg】 addr write error\n");
|
||||
return FAIL;
|
||||
}
|
||||
if (0 == soft_iic_tx_byte(0, reg_data)) {
|
||||
soft_iic_stop(0);
|
||||
xlog("SetReg: 【reg】 data write error\n");
|
||||
return FAIL;
|
||||
}
|
||||
soft_iic_stop(0);
|
||||
@ -216,5 +222,5 @@ unsigned char FM176XX_SoftReset(void){
|
||||
|
||||
void rfid_delay_ms(unsigned int ms){
|
||||
// delay(ms);
|
||||
os_time_dly(ms/10);
|
||||
mdelay(ms);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user