-
Notifications
You must be signed in to change notification settings - Fork 1.4k
add more hil tests #3557
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
add more hil tests #3557
Changes from 7 commits
a3b2b42
45e80a1
55994bc
b2a592d
3e47f1f
6c895e7
b765656
0521e66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| set(PICO_PLATFORM rp2040) | ||
| set(PICO_BOARD adafruit_feather_rp2040_usb_host) | ||
| set(CFG_TUH_RPI_PIO_USB 1) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -205,13 +205,23 @@ static int32_t board_i2c_deinit(void) { | |
| } | ||
|
|
||
| static int32_t i2c_readreg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length) { | ||
| TU_ASSERT (HAL_OK == HAL_I2C_Mem_Read(&i2c_handle, DevAddr, Reg, I2C_MEMADD_SIZE_8BIT, pData, Length, 10000)); | ||
| return 0; | ||
| for (int retry = 0; retry < 3; retry++) { | ||
| if (HAL_OK == HAL_I2C_Mem_Read(&i2c_handle, DevAddr, Reg, I2C_MEMADD_SIZE_8BIT, pData, Length, 10000)) { | ||
| return 0; | ||
| } | ||
| HAL_Delay(10); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Using Useful? React with 👍 / 👎. |
||
| } | ||
| return -1; | ||
| } | ||
|
|
||
| static int32_t i2c_writereg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length) { | ||
| TU_ASSERT(HAL_OK == HAL_I2C_Mem_Write(&i2c_handle, DevAddr, Reg, I2C_MEMADD_SIZE_8BIT, pData, Length, 10000)); | ||
| return 0; | ||
| for (int retry = 0; retry < 3; retry++) { | ||
| if (HAL_OK == HAL_I2C_Mem_Write(&i2c_handle, DevAddr, Reg, I2C_MEMADD_SIZE_8BIT, pData, Length, 10000)) { | ||
| return 0; | ||
| } | ||
| HAL_Delay(10); | ||
| } | ||
| return -1; | ||
| } | ||
|
|
||
| static int32_t i2c_get_tick(void) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.