Projekt

Allgemein

Profil

Feature #835 » crc32.diff

Maximilian Seesslen, 11.09.2026 18:02

Unterschiede anzeigen:

include/biwak/crc.hpp
40 40
      CCrc( );
41 41
      ~CCrc();
42 42
      void init();
43
      uint32_t calculateCrc32( const void *_buf, uint32_t len );
43
      uint32_t calculateCrc32( const void *_buf, uint32_t len ) const;
44 44
      
45
      uint32_t crc32Init( );
46
      uint32_t crc32Update( uint32_t crc, const void *_buf, uint32_t len );
47
      uint32_t crc32Finalize( uint32_t crc );
45
      uint32_t crc32Init( ) const;
46
      uint32_t crc32Update( uint32_t crc, const void *_buf, uint32_t len ) const;
47
      uint32_t crc32Finalize( uint32_t crc ) const;
48 48
};
49 49

  
50 50

  
src/stm32/crc.cpp
63 63
}
64 64

  
65 65

  
66
uint32_t CCrc::calculateCrc32( const void *_buf, uint32_t len)
66
uint32_t CCrc::calculateCrc32( const void *_buf, uint32_t len) const
67 67
{
68 68
      uint32_t crc;
69 69
      crc = crc32Init();
......
73 73
      return(crc);
74 74
}
75 75

  
76
uint32_t CCrc::crc32Update( uint32_t crc, const void *_buf, uint32_t len )
76
uint32_t CCrc::crc32Update( uint32_t crc, const void *_buf, uint32_t len ) const
77 77
{
78 78
   #if defined( STM32F1 )
79 79
      uint32_t part;
......
92 92
   return( crc );
93 93
}
94 94

  
95
uint32_t CCrc::crc32Finalize( uint32_t crc )
95
uint32_t CCrc::crc32Finalize( uint32_t crc ) const
96 96
{
97 97
   #if defined( STM32F1 )
98 98
      return( crc );
......
101 101
   #endif
102 102
}
103 103

  
104
uint32_t CCrc::crc32Init( )
104
uint32_t CCrc::crc32Init( ) const
105 105
{
106 106
   return( HAL_CRC_Calculate(m_pHandler, (uint32_t *)this, 0 ) );
107 107
}
(1-1/3)