mirror of
https://github.com/zlgopen/awtk.git
synced 2025-05-08 19:44:45 +08:00
improve bits_stream_get
This commit is contained in:
parent
878d640aeb
commit
14ab3bffef
@ -1653,7 +1653,7 @@ const char* ret_code_to_name(ret_t ret) {
|
||||
}
|
||||
|
||||
|
||||
ret_t bits_stream_get(uint8_t* buff, uint32_t size, uint32_t index, bool_t* value) {
|
||||
ret_t bits_stream_get(const uint8_t* buff, uint32_t size, uint32_t index, bool_t* value) {
|
||||
uint8_t v = 0;
|
||||
uint32_t offset = index % 8;
|
||||
uint32_t max_index = size * 8;
|
||||
|
@ -978,13 +978,13 @@ ret_t ret_code_from_name(const char* name);
|
||||
/**
|
||||
* @method bits_stream_get
|
||||
* 从buff中获取第index位的值。
|
||||
* @param {uint8_t*} buff 数据。
|
||||
* @param {const uint8_t*} buff 数据。
|
||||
* @param {uint32_t} size 数据长度。
|
||||
* @param {uint32_t} index 位索引。
|
||||
* @param {bool_t*} value 返回值。
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t bits_stream_get(uint8_t* buff, uint32_t size, uint32_t index, bool_t* value);
|
||||
ret_t bits_stream_get(const uint8_t* buff, uint32_t size, uint32_t index, bool_t* value);
|
||||
|
||||
/**
|
||||
* @method bits_stream_set
|
||||
|
Loading…
x
Reference in New Issue
Block a user