单步运行的步骤大概是下面这个样子的,运行到return语句为什么会不跳出这个函数呢?而是继续返回到函数里面,这个是ADS1.2环境下,是uc/fs源代码里的一个函数?为什么执行完return还不结束呢?红色是单步的过程……
int FS__lb_write(const FS__device_type *pDriver, FS_u32 Unit, FS_u32 Sector, void *pBuffer) {
int x;
if (pDriver->dev_write) {
FS_X_OS_LockDeviceOp(pDriver, Unit);
x = (pDriver->dev_write)(Unit, Sector, pBuffer);
#if FS_USE_LB_READCACHE
if (x==0) {
_FS_LB_UpdateInCache(pDriver, Unit, Sector, pBuffer);
}
else {
_FS_LB_ClearCache(pDriver, Unit);
}
#endif /* FS_USE_LB_READCACHE */
FS_X_OS_UnlockDeviceOp(pDriver, Unit);
return x;
}
return -1;
}
int FS__lb_write(const FS__device_type *pDriver, FS_u32 Unit, FS_u32 Sector, void *pBuffer) {
int x;
if (pDriver->dev_write) {
FS_X_OS_LockDeviceOp(pDriver, Unit);
x = (pDriver->dev_write)(Unit, Sector, pBuffer);
#if FS_USE_LB_READCACHE
if (x==0) {
_FS_LB_UpdateInCache(pDriver, Unit, Sector, pBuffer);
}
else {
_FS_LB_ClearCache(pDriver, Unit);
}
#endif /* FS_USE_LB_READCACHE */
FS_X_OS_UnlockDeviceOp(pDriver, Unit);
return x;
}
return -1;
}
int FS__lb_write(const FS__device_type *pDriver, FS_u32 Unit, FS_u32 Sector, void *pBuffer) {
int x;
if (pDriver->dev_write) {
FS_X_OS_LockDeviceOp(pDriver, Unit);
x = (pDriver->dev_write)(Unit, Sector, pBuffer);
#if FS_USE_LB_READCACHE
if (x==0) {
_FS_LB_UpdateInCache(pDriver, Unit, Sector, pBuffer);
}
else {
_FS_LB_ClearCache(pDriver, Unit);
}
#endif /* FS_USE_LB_READCACHE */
FS_X_OS_UnlockDeviceOp(pDriver, Unit);
return x;
}
return -1;
}
int FS__lb_write(const FS__device_type *pDriver, FS_u32 Unit, FS_u32 Sector, void *pBuffer) {
int x;
if (pDriver->dev_write) {
FS_X_OS_LockDeviceOp(pDriver, Unit);
x = (pDriver->dev_write)(Unit, Sector, pBuffer);
#if FS_USE_LB_READCACHE
if (x==0) {
_FS_LB_UpdateInCache(pDriver, Unit, Sector, pBuffer);
}
else {
_FS_LB_ClearCache(pDriver, Unit);
}
#endif /* FS_USE_LB_READCACHE */
FS_X_OS_UnlockDeviceOp(pDriver, Unit);
return x;
}
return -1;
}
int FS__lb_write(const FS__device_type *pDriver, FS_u32 Unit, FS_u32 Sector, void *pBuffer) {
int x;
if (pDriver->dev_write) {
FS_X_OS_LockDeviceOp(pDriver, Unit);
x = (pDriver->dev_write)(Unit, Sector, pBuffer);
#if FS_USE_LB_READCACHE
if (x==0) {
_FS_LB_UpdateInCache(pDriver, Unit, Sector, pBuffer);
}
else {
_FS_LB_ClearCache(pDriver, Unit);
}
#endif /* FS_USE_LB_READCACHE */
FS_X_OS_UnlockDeviceOp(pDriver, Unit);
return x;
}
return -1;
}
int FS__lb_write(const FS__device_type *pDriver, FS_u32 Unit, FS_u32 Sector, void *pBuffer) {
int x;
if (pDriver->dev_write) {
FS_X_OS_LockDeviceOp(pDriver, Unit);
x = (pDriver->dev_write)(Unit, Sector, pBuffer);
#if FS_USE_LB_READCACHE
if (x==0) {
_FS_LB_UpdateInCache(pDriver, Unit, Sector, pBuffer);
}
else {
_FS_LB_ClearCache(pDriver, Unit);
}
#endif /* FS_USE_LB_READCACHE */
FS_X_OS_UnlockDeviceOp(pDriver, Unit);
return x;
}
return -1;
} |