File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,11 @@ extern "C" {
135135#endif
136136 void crcInit (void );
137137 void crcObjectInit (CRCDriver * crcp );
138+ #if (defined(STM32F1xx ) || defined(STM32F2xx ) || defined(STM32F4xx ) || defined(STM32L1xx )) // Those MCU dont have programmable CRC registers
139+ void crcStart (CRCDriver * crcp );
140+ #else
138141 void crcStart (CRCDriver * crcp , const CRCConfig * config );
142+ #endif
139143 void crcStop (CRCDriver * crcp );
140144 void crcReset (CRCDriver * crcp );
141145 void crcResetI (CRCDriver * crcp );
Original file line number Diff line number Diff line change @@ -81,6 +81,19 @@ void crcObjectInit(CRCDriver *crcp) {
8181 *
8282 * @api
8383 */
84+
85+ #if (defined(STM32F1xx ) || defined(STM32F2xx ) || defined(STM32F4xx ) || defined(STM32L1xx )) // Those MCU dont have programmable CRC registers
86+ void crcStart (CRCDriver * crcp ) {
87+ osalDbgCheck (crcp != NULL );
88+
89+ osalSysLock ();
90+ osalDbgAssert ((crcp -> state == CRC_STOP ) || (crcp -> state == CRC_READY ),
91+ "invalid state" );
92+ crc_lld_start (crcp );
93+ crcp -> state = CRC_READY ;
94+ osalSysUnlock ();
95+ }
96+ #else
8497void crcStart (CRCDriver * crcp , const CRCConfig * config ) {
8598 osalDbgCheck (crcp != NULL );
8699
@@ -92,6 +105,7 @@ void crcStart(CRCDriver *crcp, const CRCConfig *config) {
92105 crcp -> state = CRC_READY ;
93106 osalSysUnlock ();
94107}
108+ #endif
95109
96110/**
97111 * @brief Deactivates the CRC peripheral.
You can’t perform that action at this time.
0 commit comments