-
Notifications
You must be signed in to change notification settings - Fork 621
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
Feature/support sccb handle 16bit val #474
Feature/support sccb handle 16bit val #474
Conversation
@me-no-dev Some sensor registers need to read and write 16 bit values, so two APIs have been added. PTAL,Thanks. |
if(ret != ESP_OK) { | ||
ESP_LOGE(TAG, "W [%04x]=%04x fail\n", reg, data); | ||
} | ||
return ret == ESP_OK ? 0 : -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe switch return type to esp_err_t
, because currently you have it as uint8_t
, but here you are returning -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this would need to be done for the other write
methods as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current sensor driver code has many expressions similar to if(SCCB_Write() < 0)
, so although the return value type can be defined as esp_err_t
in the function declaration, in the relevant code, we only check whether the return value of the function is less than 0. Therefore, there are two options.
- We only define the return value type of the function as
esp_err_t
in the function declaration, and do not really return the return value of thei2c_master_cmd_begin()
. - Or we can directly define the return value of this function as type
int
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case, using int
or int8_t
would also do the job
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return value of sccb_write()
has been changed to type int
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@me-no-dev ,At present, it is not easy to buy some cameras that support JPEG encoding. A new sensor driver can work normally, but the current submission is required. If there is no problem, please help merge the submission. We will submit the driver code of the new camera as soon as possible. thanks.
It's in :) |
No description provided.