From 5758b739f1b14e7699156a2c47ac44d41934578d Mon Sep 17 00:00:00 2001 From: Ramesh <38435057+rmshub@users.noreply.github.com> Date: Wed, 10 Jul 2019 08:55:36 +0530 Subject: [PATCH] Fixed the bug that the malloc memory size is smaller than the actual required. --- .../mcpwm_basic_config/main/mcpwm_basic_config_example.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/peripherals/mcpwm/mcpwm_basic_config/main/mcpwm_basic_config_example.c b/examples/peripherals/mcpwm/mcpwm_basic_config/main/mcpwm_basic_config_example.c index 3fc02e6dad..1132149a14 100644 --- a/examples/peripherals/mcpwm/mcpwm_basic_config/main/mcpwm_basic_config_example.c +++ b/examples/peripherals/mcpwm/mcpwm_basic_config/main/mcpwm_basic_config_example.c @@ -138,8 +138,8 @@ static void gpio_test_signal(void *arg) */ static void disp_captured_signal(void *arg) { - uint32_t *current_cap_value = (uint32_t *)malloc(sizeof(CAP_SIG_NUM)); - uint32_t *previous_cap_value = (uint32_t *)malloc(sizeof(CAP_SIG_NUM)); + uint32_t *current_cap_value = (uint32_t *)malloc(CAP_SIG_NUM*sizeof(uint32_t)); + uint32_t *previous_cap_value = (uint32_t *)malloc(CAP_SIG_NUM*sizeof(uint32_t)); capture evt; while (1) { xQueueReceive(cap_queue, &evt, portMAX_DELAY);