File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,9 @@ void hal_crc_compute_partial_start(const uint32_t polynomial);
114
114
* To obtain the final result of the CRC calculation hal_crc_get_result() is
115
115
* called to apply the final transformations to the data.
116
116
*
117
+ * If the function is passed an undefined pointer, or the size of the buffer is
118
+ * specified to be 0, this function will do nothing and return.
119
+ *
117
120
* This function can be call multiple times in succession, this can be used
118
121
* to calculate the CRC result of streamed data.
119
122
*
Original file line number Diff line number Diff line change @@ -73,14 +73,21 @@ void hal_crc_compute_partial_start(const uint32_t polynomial)
73
73
}
74
74
default :
75
75
MBED_ASSERT ("Configuring Mbed CRC with unsupported polynomial" );
76
- break ;
76
+
77
+ return ;
77
78
}
78
79
79
80
CRC_Init (CRC0 , & config );
80
81
}
81
82
82
83
void hal_crc_compute_partial (const uint8_t * data , const size_t size )
83
84
{
85
+ if (data == NULL )
86
+ return ;
87
+
88
+ if (size == 0 )
89
+ return ;
90
+
84
91
CRC_WriteData (CRC0 , data , size );
85
92
}
86
93
You can’t perform that action at this time.
0 commit comments