build: Fix the warnings that break the tests

unused variable 'lfn'
    'isr_handler' defined but not used
    'servo_set_angle' defined but not used
    'gpio_test_signal' defined but not used
    'change_duty' defined but not used
This commit is contained in:
Anton Maklakov 2017-06-30 15:46:31 +08:00
parent 3cd10899e6
commit 3d1d4fe150
4 changed files with 20 additions and 14 deletions

View File

@ -3673,8 +3673,9 @@ FRESULT f_sync (
FATFS *fs; FATFS *fs;
DWORD tm; DWORD tm;
BYTE *dir; BYTE *dir;
#if _FS_EXFAT
DEF_NAMBUF DEF_NAMBUF
#endif
res = validate(&fp->obj, &fs); /* Check validity of the file object */ res = validate(&fp->obj, &fs); /* Check validity of the file object */
if (res == FR_OK) { if (res == FR_OK) {

View File

@ -59,7 +59,9 @@ typedef struct {
} capture; } capture;
xQueueHandle cap_queue; xQueueHandle cap_queue;
#if MCPWM_EN_CAPTURE
static mcpwm_dev_t *MCPWM[2] = {&MCPWM0, &MCPWM1}; static mcpwm_dev_t *MCPWM[2] = {&MCPWM0, &MCPWM1};
#endif
static void mcpwm_example_gpio_initialize() static void mcpwm_example_gpio_initialize()
{ {
@ -162,6 +164,7 @@ static void disp_captured_signal(void *arg)
} }
} }
#if MCPWM_EN_CAPTURE
/** /**
* @brief this is ISR handler function, here we check for interrupt that triggers rising edge on CAP0 signal and according take action * @brief this is ISR handler function, here we check for interrupt that triggers rising edge on CAP0 signal and according take action
*/ */
@ -187,6 +190,7 @@ static void IRAM_ATTR isr_handler()
} }
MCPWM[MCPWM_UNIT_0]->int_clr.val = mcpwm_intr_status; MCPWM[MCPWM_UNIT_0]->int_clr.val = mcpwm_intr_status;
} }
#endif
/** /**
* @brief Configure whole MCPWM module * @brief Configure whole MCPWM module

View File

@ -27,7 +27,10 @@
#include "soc/mcpwm_struct.h" #include "soc/mcpwm_struct.h"
#define INITIAL_DUTY 10.0 //initial duty cycle is 10.0% #define INITIAL_DUTY 10.0 //initial duty cycle is 10.0%
#define MCPWM_GPIO_INIT 0 //select which function to use to initialize gpio signals #define MCPWM_GPIO_INIT 0 //select which function to use to initialize gpio signals
#define GPIO_HALL_TEST_SIGNAL 0 //Make this 1 to enable generation of hall sensors test signal on GPIO13, 12, 14
#define CHANGE_DUTY_CONTINUOUSLY 0 //Make this 1 to change duty continuously
#define CAP_SIG_NUM 3 //three capture signals from HALL-A, HALL-B, HALL-C #define CAP_SIG_NUM 3 //three capture signals from HALL-A, HALL-B, HALL-C
#define CAP0_INT_EN BIT(27) //Capture 0 interrupt bit #define CAP0_INT_EN BIT(27) //Capture 0 interrupt bit
@ -94,6 +97,7 @@ static void mcpwm_example_gpio_initialize()
gpio_pulldown_en(GPIO_CAP2_IN); //Enable pull down on CAP2 signal gpio_pulldown_en(GPIO_CAP2_IN); //Enable pull down on CAP2 signal
} }
#if GPIO_HALL_TEST_SIGNAL
/** /**
* @brief Set gpio 13, 12, 14 as our test signal of hall sensors, that generates high-low waveform continuously * @brief Set gpio 13, 12, 14 as our test signal of hall sensors, that generates high-low waveform continuously
* Attach this pins to GPIO 27, 26, 25 respectively for capture unit * Attach this pins to GPIO 27, 26, 25 respectively for capture unit
@ -123,6 +127,7 @@ static void gpio_test_signal(void *arg)
vTaskDelay(1); vTaskDelay(1);
} }
} }
#endif
/** /**
* @brief When interrupt occurs, we receive the counter value and display the time between two rising edge * @brief When interrupt occurs, we receive the counter value and display the time between two rising edge
@ -181,6 +186,7 @@ static void IRAM_ATTR isr_handler()
MCPWM[MCPWM_UNIT_0]->int_clr.val = mcpwm_intr_status; MCPWM[MCPWM_UNIT_0]->int_clr.val = mcpwm_intr_status;
} }
#if CHANGE_DUTY_CONTINUOUSLY
static void change_duty(void *arg) static void change_duty(void *arg)
{ {
int j; int j;
@ -197,6 +203,7 @@ static void change_duty(void *arg)
} }
} }
} }
#endif
/** /**
* @brief Configure whole MCPWM module for bldc motor control * @brief Configure whole MCPWM module for bldc motor control
@ -304,9 +311,13 @@ static void mcpwm_example_bldc_control(void *arg)
void app_main() void app_main()
{ {
printf("Testing MCPWM BLDC Control...\n"); printf("Testing MCPWM BLDC Control...\n");
//xTaskCreate(change_duty, "change_duty", 2048, NULL, 2, NULL); //uncomment to change duty continuously #if CHANGE_DUTY_CONTINUOUSLY
xTaskCreate(change_duty, "change_duty", 2048, NULL, 2, NULL);
#endif
cap_queue = xQueueCreate(1, sizeof(capture)); //comment if you don't want to use capture module cap_queue = xQueueCreate(1, sizeof(capture)); //comment if you don't want to use capture module
//xTaskCreate(gpio_test_signal, "gpio_test_signal", 2048, NULL, 2, NULL); #if GPIO_HALL_TEST_SIGNAL
xTaskCreate(gpio_test_signal, "gpio_test_signal", 2048, NULL, 2, NULL);
#endif
xTaskCreate(disp_captured_signal, "mcpwm_config", 4096, NULL, 2, NULL); //comment if you don't want to use capture module xTaskCreate(disp_captured_signal, "mcpwm_config", 4096, NULL, 2, NULL); //comment if you don't want to use capture module
xTaskCreate(mcpwm_example_bldc_control, "mcpwm_example_bldc_control", 4096, NULL, 2, NULL); xTaskCreate(mcpwm_example_bldc_control, "mcpwm_example_bldc_control", 4096, NULL, 2, NULL);
} }

View File

@ -42,16 +42,6 @@ static uint32_t servo_per_degree_init(uint32_t degree_of_rotation)
return cal_pulsewidth; return cal_pulsewidth;
} }
/**
* @brief directly set servo motor to a particular angle
*/
static void servo_set_angle(uint32_t angle_of_rotation)
{
uint32_t angle_t;
angle_t = servo_per_degree_init(angle_of_rotation);
mcpwm_set_duty_in_us(MCPWM_UNIT_0, MCPWM_TIMER_0, MCPWM_OPR_A, angle_t);
}
/** /**
* @brief Configure MCPWM module * @brief Configure MCPWM module
*/ */