2023-05-23 03:38 AM
Hello all,
I'm using the HAL library for the camera, specifically I'm using the function:
HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef *hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length)
In the function are many return HAL_ERROR, and one HAL_OK. When the function works fine It return a 0, but when I have an error it return 2.
Why It retuns 2 if the HAL_ERROR is defined as 1 when I have an error.
Solved! Go to Solution.
2023-05-23 03:49 AM
I think 2 is busy:
typedef enum
{
HAL_OK = 0x00U,
HAL_ERROR = 0x01U,
HAL_BUSY = 0x02U,
HAL_TIMEOUT = 0x03U
} HAL_StatusTypeDef;
2023-05-23 03:49 AM
I think 2 is busy:
typedef enum
{
HAL_OK = 0x00U,
HAL_ERROR = 0x01U,
HAL_BUSY = 0x02U,
HAL_TIMEOUT = 0x03U
} HAL_StatusTypeDef;
2023-05-23 03:59 AM
Ohh, Okey, I see that a function inside could return a HAL_BUSY, but the main function only could return HAL_OK and HAL_ERROR, so why It return the HAL_BUSY??. The return of the subfunction is only used in the subfunction no??
2023-05-23 04:10 AM
I don't know that function.
Check it again, then debug it.
2023-05-23 04:13 AM
Hello,
if you have:
status = function(...);
and later you have
return status;
then status might be the return value of the sub-function.
As LCE wrote, please use the debugger so you can better understand where you get HAL_BUSY.
2023-05-23 04:14 AM
I will try to debug it! Thanks for the help!