Merge branch 'bugfix/misc_fixes' into 'master'

Misc fixes (including Github PRs)

Collection of single commit fixes, including several from Github.

See merge request !457
This commit is contained in:
Ivan Grokhotkov 2017-01-20 17:53:12 +08:00
commit 374d03093c
6 changed files with 26 additions and 8 deletions

View file

@ -449,7 +449,8 @@ esp_err_t esp_ble_gatts_stop_service(uint16_t service_handle);
* @param[in] attr_handle - attribute handle to indicate.
* @param[in] value_len - indicate value length.
* @param[in] value: value to indicate.
* @param[in] need_confirm - if this indication expects a confirmation or not.
* @param[in] need_confirm - Whether a confirmation is required.
* false sends a GATT notification, true sends a GATT indication.
*
* @return
* - ESP_OK : success

View file

@ -133,10 +133,10 @@ esp_err_t gpio_set_intr_type(gpio_num_t gpio_num, gpio_int_type_t intr_type)
return ESP_OK;
}
esp_err_t gpio_intr_enable(gpio_num_t gpio_num)
static esp_err_t gpio_intr_enable_on_core (gpio_num_t gpio_num, uint32_t core_id)
{
GPIO_CHECK(GPIO_IS_VALID_GPIO(gpio_num), "GPIO number error", ESP_ERR_INVALID_ARG);
if (xPortGetCoreID() == 0) {
if (core_id == 0) {
GPIO.pin[gpio_num].int_ena = GPIO_PRO_CPU_INTR_ENA; //enable pro cpu intr
} else {
GPIO.pin[gpio_num].int_ena = GPIO_APP_CPU_INTR_ENA; //enable pro cpu intr
@ -144,6 +144,11 @@ esp_err_t gpio_intr_enable(gpio_num_t gpio_num)
return ESP_OK;
}
esp_err_t gpio_intr_enable(gpio_num_t gpio_num)
{
return gpio_intr_enable_on_core (gpio_num, xPortGetCoreID());
}
esp_err_t gpio_intr_disable(gpio_num_t gpio_num)
{
GPIO_CHECK(GPIO_IS_VALID_GPIO(gpio_num), "GPIO number error", ESP_ERR_INVALID_ARG);
@ -380,7 +385,7 @@ esp_err_t gpio_isr_handler_add(gpio_num_t gpio_num, gpio_isr_t isr_handler, void
gpio_isr_func[gpio_num].fn = isr_handler;
gpio_isr_func[gpio_num].args = args;
}
gpio_intr_enable(gpio_num);
gpio_intr_enable_on_core (gpio_num, esp_intr_get_cpu(gpio_isr_handle));
portEXIT_CRITICAL(&gpio_spinlock);
return ESP_OK;
}

View file

@ -1,6 +1,10 @@
#ifndef PANIC_H
#define PANIC_H
#ifdef __cplusplus
extern "C"
{
#endif
#define PANIC_RSN_NONE 0
#define PANIC_RSN_DEBUGEXCEPTION 1
@ -59,4 +63,8 @@ void esp_clear_watchpoint(int no);
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -122,6 +122,7 @@ typedef volatile struct {
uint32_t lstimer1_ovf: 1; /*The interrupt status bit for low speed channel1 counter overflow event.*/
uint32_t lstimer2_ovf: 1; /*The interrupt status bit for low speed channel2 counter overflow event.*/
uint32_t lstimer3_ovf: 1; /*The interrupt status bit for low speed channel3 counter overflow event.*/
uint32_t duty_chng_end_hsch0: 1; /*The interrupt enable bit for high speed channel 0 duty change done event.*/
uint32_t duty_chng_end_hsch1: 1; /*The interrupt status bit for high speed channel 1 duty change done event.*/
uint32_t duty_chng_end_hsch2: 1; /*The interrupt status bit for high speed channel 2 duty change done event.*/
uint32_t duty_chng_end_hsch3: 1; /*The interrupt status bit for high speed channel 3 duty change done event.*/

View file

@ -880,10 +880,11 @@ netconn_gethostbyname(const char *name, ip_addr_t *addr)
{
API_VAR_DECLARE(struct dns_api_msg, msg);
err_t localerr;
#if !LWIP_MPU_COMPATIBLE
sys_sem_t sem;
#endif /* LWIP_MPU_COMPATIBLE */
err_t err;
err_t err = ERR_OK;
LWIP_ERROR("netconn_gethostbyname: invalid name", (name != NULL), return ERR_ARG;);
LWIP_ERROR("netconn_gethostbyname: invalid addr", (addr != NULL), return ERR_ARG;);
@ -918,14 +919,14 @@ netconn_gethostbyname(const char *name, ip_addr_t *addr)
}
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
err = tcpip_callback(lwip_netconn_do_gethostbyname, &API_VAR_REF(msg));
if (err != ERR_OK) {
localerr = tcpip_callback(lwip_netconn_do_gethostbyname, &API_VAR_REF(msg));
if (localerr != ERR_OK) {
#if !LWIP_NETCONN_SEM_PER_THREAD
sys_sem_free(API_EXPR_REF(API_VAR_REF(msg).sem));
#endif /* !LWIP_NETCONN_SEM_PER_THREAD */
API_VAR_FREE(MEMP_DNS_API_MSG, msg);
return err;
return localerr;
}
sys_sem_wait(API_EXPR_REF_SEM(API_VAR_REF(msg).sem));

View file

@ -250,6 +250,8 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i
gl_profile_tab[PROFILE_A_APP_ID].conn_id = param->connect.conn_id;
break;
case ESP_GATTS_DISCONNECT_EVT:
esp_ble_gap_start_advertising(&test_adv_params);
break;
case ESP_GATTS_OPEN_EVT:
case ESP_GATTS_CANCEL_OPEN_EVT:
case ESP_GATTS_CLOSE_EVT: