File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 4040#include "simplelink.h"
4141
4242
43- static _SlLockObj_t hash_LockObj ;
44-
45-
43+ /******************************************************************************
44+ DEFINE PUBLIC FUNCTIONS
45+ ******************************************************************************/
4646void HASH_Init (void ) {
4747 // Enable the Data Hashing and Transform Engine
4848 MAP_PRCMPeripheralClkEnable (PRCM_DTHE , PRCM_RUN_MODE_CLK | PRCM_SLP_MODE_CLK );
49- sl_LockObjCreate ( & hash_LockObj , "HashLock" );
49+ MAP_PRCMPeripheralReset ( PRCM_DTHE );
5050}
5151
5252void HASH_SHAMD5Start (uint32_t algo , uint32_t blocklen ) {
53- sl_LockObjLock (& hash_LockObj , SL_OS_WAIT_FOREVER );
54- // reset the perihperal before starting any new operation
55- MAP_PRCMPeripheralReset (PRCM_DTHE );
56-
5753 // wait until the context is ready
5854 while ((HWREG (SHAMD5_BASE + SHAMD5_O_IRQSTATUS ) & SHAMD5_INT_CONTEXT_READY ) == 0 );
5955
@@ -79,5 +75,4 @@ void HASH_SHAMD5Read (uint8_t *hash) {
7975 while ((HWREG (SHAMD5_BASE + SHAMD5_O_IRQSTATUS ) & SHAMD5_INT_OUTPUT_READY ) == 0 );
8076 // read the result
8177 MAP_SHAMD5ResultRead (SHAMD5_BASE , hash );
82- sl_LockObjUnlock (& hash_LockObj );
8378}
Original file line number Diff line number Diff line change 2727#ifndef HASH_H_
2828#define HASH_H_
2929
30+ /******************************************************************************
31+ DECLARE PUBLIC FUNCTIONS
32+ ******************************************************************************/
3033extern void HASH_Init (void );
3134extern void HASH_SHAMD5Start (uint32_t algo , uint32_t blocklen );
3235extern void HASH_SHAMD5Update (uint8_t * data , uint32_t datalen );
3336extern void HASH_SHAMD5Read (uint8_t * hash );
3437
35-
3638#endif /* HASH_H_ */
You can’t perform that action at this time.
0 commit comments