Skip to content

Commit

Permalink
Removing unnecessary macro
Browse files Browse the repository at this point in the history
  • Loading branch information
nwdepatie committed Mar 13, 2024
1 parent 51263a7 commit e045ccc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions CM7/Core/Inc/gatedriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include <stdbool.h>
#include <stdint.h>

#define MAX_ADC_BUF 7

/*
* Note that these phases readings should ALWAYS be mapped to the corresponding indices
* Ensure the ADC DMA is mapped the same across boards
Expand All @@ -23,7 +21,7 @@ enum {
enum {
GATEDRV_DC_CURRENT = GATEDRV_NUM_PHASES, /* Keep index rolling from phase enum */
GATEDRV_IGBT_TEMP,
SIZE_OF_ADC_DMA
GATEDRV_SIZE_OF_ADC_DMA
};

/* Definition of gatedriver struct */
Expand All @@ -35,7 +33,7 @@ typedef struct {

ADC_HandleTypeDef *hdma_adc;
SPI_HandleTypeDef *adc_spi;
uint32_t intern_adc_buffer[SIZE_OF_ADC_DMA];
uint32_t intern_adc_buffer[GATEDRV_SIZE_OF_ADC_DMA];

osMutexId_t* tim_mutex_mutex;
osMutexAttr_t tim_mutex_attr;
Expand Down
2 changes: 1 addition & 1 deletion CM7/Core/Src/gatedriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ gatedriver_t* gatedrv_init(TIM_HandleTypeDef* tim, ADC_HandleTypeDef *hdma_adc,
gatedriver->pwm_cfg = &pwm_cfg;

/* Configure DMA */
assert(HAL_ADC_Start_DMA(gatedriver->hdma_adc, gatedriver->intern_adc_buffer, MAX_ADC_BUF));
assert(HAL_ADC_Start_DMA(gatedriver->hdma_adc, gatedriver->intern_adc_buffer, GATEDRV_SIZE_OF_ADC_DMA));

/* Create Mutexes */
gatedriver->tim_mutex = osMutexNew(&gatedriver->tim_mutex_attr);
Expand Down

0 comments on commit e045ccc

Please sign in to comment.