Pull request #17: am64x/am243x: SDFM: Resolve sdfm handle initialization issue
Merge in PINDSW/motor_control_sdk from a0502729_PINDSW-6607_SDFM_resolve_static_code_analysis_bug to next * commit 'd2aad2c201019065a56046effbe03666e3743512': am64x/am243x: SDFM: Remove sdfm handle null initialization
This commit is contained in:
commit
60c76e58dc
@ -384,11 +384,11 @@ void pruSdfmIrqHandler(void *args)
|
|||||||
PRUICSS_clearEvent(gPruIcssHandle, PRU_TRIGGER_HOST_SDFM_EVT);
|
PRUICSS_clearEvent(gPruIcssHandle, PRU_TRIGGER_HOST_SDFM_EVT);
|
||||||
|
|
||||||
/* SDFM Output sample for Channel 0 */
|
/* SDFM Output sample for Channel 0 */
|
||||||
sdfm_ch0_samples[sdfm_ch0_idx++] = SDFM_getFilterData(0);
|
sdfm_ch0_samples[sdfm_ch0_idx++] = SDFM_getFilterData(gHPruSdfm, 0);
|
||||||
/* SDFM Output sample for Channel 1 */
|
/* SDFM Output sample for Channel 1 */
|
||||||
sdfm_ch1_samples[sdfm_ch1_idx++] = SDFM_getFilterData(1);
|
sdfm_ch1_samples[sdfm_ch1_idx++] = SDFM_getFilterData(gHPruSdfm, 1);
|
||||||
/* SDFM Output sample for Channel 2 */
|
/* SDFM Output sample for Channel 2 */
|
||||||
sdfm_ch2_samples[sdfm_ch2_idx++] = SDFM_getFilterData(2);
|
sdfm_ch2_samples[sdfm_ch2_idx++] = SDFM_getFilterData(gHPruSdfm, 2);
|
||||||
|
|
||||||
|
|
||||||
if(sdfm_ch0_idx >= MAX_SAMPLES)
|
if(sdfm_ch0_idx >= MAX_SAMPLES)
|
||||||
|
|||||||
@ -243,7 +243,7 @@ int32_t init_sdfm_pru_fw(uint8_t pruId, SdfmPrms *pSdfmPrms, sdfm_handle *pHSdfm
|
|||||||
/* Enable (global) SDFM */
|
/* Enable (global) SDFM */
|
||||||
SDFM_enable(hSdfm);
|
SDFM_enable(hSdfm);
|
||||||
|
|
||||||
pHSdfm = &hSdfm;
|
*pHSdfm = hSdfm;
|
||||||
|
|
||||||
return SDFM_ERR_NERR;
|
return SDFM_ERR_NERR;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -284,11 +284,9 @@ void SDFM_configComparatorGpioPins(sdfm_handle h_sdfm, uint8_t ch,uint32_t gpio_
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get current (or latest) sample for the specified channel */
|
/* Get current (or latest) sample for the specified channel */
|
||||||
uint32_t SDFM_getFilterData(uint8_t ch)
|
uint32_t SDFM_getFilterData(sdfm_handle h_sdfm, uint8_t ch)
|
||||||
{
|
{
|
||||||
SDFM *p_sdfm = NULL;
|
return h_sdfm->p_sdfm_interface->curr_out_samp_buf[ch];
|
||||||
p_sdfm->p_sdfm_interface = (SDFM_Interface *)(PRU_ICSSG_DRAM0_SLV_RAM + 0x0);
|
|
||||||
return p_sdfm->p_sdfm_interface->curr_out_samp_buf[ch];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Configure normal current OSR for data filter*/
|
/*Configure normal current OSR for data filter*/
|
||||||
|
|||||||
@ -268,14 +268,14 @@ void SDFM_configComparatorGpioPins(sdfm_handle h_sdfm, uint8_t ch,uint32_t gpio_
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* \brief get sample data from DMEM
|
* \brief get sample data from DMEM
|
||||||
*
|
* \param[in] h_sdfm SDFM handle
|
||||||
* \param[in] ch current ch number
|
* \param[in] ch current ch number
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* \retval current sample value
|
* \retval current sample value
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint32_t SDFM_getFilterData(uint8_t ch);
|
uint32_t SDFM_getFilterData(sdfm_handle h_sdfm,uint8_t ch);
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* \brief Configure iep count for normal current sampling
|
* \brief Configure iep count for normal current sampling
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user