-
Notifications
You must be signed in to change notification settings - Fork 132
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
component(bsp_devkit): change led_indicator version to ^1, , button to ^4 (BSP-646) #526
base: master
Are you sure you want to change the base?
component(bsp_devkit): change led_indicator version to ^1, , button to ^4 (BSP-646) #526
Conversation
a2d2434
to
2d5d736
Compare
This PR is duplicated to #523 but you cannot only change the version of button component. The BSP must be changed a lot. |
bf8c7ad
to
73db02a
Compare
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.
@InfiniteYuan Great job! Thank you for these changes! Left some comments.
#define BUTTON_TYPE_ADC(n) CONFIG_BSP_BUTTON_##n##_TYPE_ADC | ||
#define BUTTON_TYPE_GPIO(n) CONFIG_BSP_BUTTON_##n##_TYPE_GPIO | ||
|
||
#define BSP_IOT_BUTTON_CREATE_INTERNAL(i) \ |
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.
Is it possible to make it as runtime function?
static esp_err_t bsp_iot_button_create_internal(int i){ ... }
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.
Can't,
Because in BSP_IOT_BUTTON_CREATE_INTERNAL macro definition, have another macro definition bsp_btn_cfg(n)
btn_array[i] = iot_button_create(&bsp_button_config[i]); | ||
if (btn_array[i] == NULL) { | ||
ret = ESP_FAIL; | ||
switch (i) { |
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.
Can you simplify it? (remove switch
) and make somethink like that:
if (CONFIG_BSP_BUTTONS_NUM > i) {
ret |= bsp_iot_button_create_internal(i+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.
Also can't do it, Because Macro definitions need to be determined at compile time.
73db02a
to
6e5c753
Compare
ESP-BSP Pull Request checklist
Change description