-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/update_dueros_v3.2' into 'master'
clouds: Update dueros to v3.2 See merge request adf/esp-adf-internal!1234
- Loading branch information
Showing
120 changed files
with
4,420 additions
and
3,671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
if (DEFINED ENV{DUER_PATH}) | ||
include($ENV{DUER_PATH}/libduer.cmake) | ||
return() | ||
endif() | ||
|
||
set(COMPONENT_ADD_INCLUDEDIRS ./dueros/lightduer/include) | ||
|
||
# Edit following two lines to set component requirements (see docs) | ||
set(COMPONENT_SRCS ) | ||
|
||
|
||
register_component() | ||
IF ((CONFIG_IDF_TARGET STREQUAL "esp32c3") OR (CONFIG_IDF_TARGET STREQUAL "esp32c6")) | ||
ELSE() | ||
IF (IDF_VERSION_MAJOR GREATER 3) | ||
target_link_libraries(${COMPONENT_TARGET} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/dueros/lightduer") | ||
|
||
target_link_libraries(${COMPONENT_TARGET} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/dueros/lightduer/${CONFIG_IDF_TARGET}") | ||
|
||
IF ((CONFIG_IDF_TARGET STREQUAL "esp32") OR (CONFIG_IDF_TARGET STREQUAL "esp32s3") OR (CONFIG_IDF_TARGET STREQUAL "esp32p4")) | ||
IF (IDF_VERSION_MAJOR GREATER 4) | ||
target_link_libraries(${COMPONENT_TARGET} INTERFACE duer-device-v5x) | ||
ELSEIF (IDF_VERSION_MAJOR GREATER 3) | ||
target_link_libraries(${COMPONENT_TARGET} INTERFACE duer-device-v4x) | ||
ELSE () | ||
target_link_libraries(${COMPONENT_TARGET} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/dueros/lightduer") | ||
target_link_libraries(${COMPONENT_TARGET} INTERFACE duer-device) | ||
ENDIF (IDF_VERSION_MAJOR GREATER 3) | ||
|
||
ENDIF (IDF_VERSION_MAJOR GREATER 4) | ||
ELSE() | ||
ENDIF() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
components/clouds/dueros/lightduer/include/lightduer_base_coding.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* Copyright (2017) Baidu Inc. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
// Author: Su Hao ([email protected]) | ||
// | ||
// Description: Encode & decode the int8 into base16/32/64. | ||
|
||
#ifndef BAIDU_DUER_LIBDUER_DEVICE_MODULES_SONIC_CODEC_LIGHTDUER_BASE_CODING_H | ||
#define BAIDU_DUER_LIBDUER_DEVICE_MODULES_SONIC_CODEC_LIGHTDUER_BASE_CODING_H | ||
|
||
#include "lightduer_types.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* Coding the data base on the bits. | ||
* | ||
* @param dst The output data that will be encoded | ||
* @param dlen The output data capacity | ||
* @param dbits The bits of output data unit | ||
* @param src The input data | ||
* @param slen The input data size | ||
* @param sbits The bits of input data unit | ||
* @return if < 0, means coding failed; | ||
* else, return the encoded data length. | ||
*/ | ||
DUER_INT duer_status_t duer_base_coding(char *dst, duer_size_t dlen, duer_size_t dbits, const char *src, duer_size_t slen, duer_size_t sbits); | ||
|
||
/** | ||
* Obtain the encode string need length. | ||
* | ||
* @param dbits The bits of output data unit | ||
* @param sbits The bits of input data unit | ||
* @param slen The input data size | ||
* @return the output data size | ||
*/ | ||
DUER_INT duer_size_t duer_base_encoded_length(duer_size_t dbits, duer_size_t sbits, duer_size_t slen); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // BAIDU_DUER_LIBDUER_DEVICE_MODULES_SONIC_CODEC_LIGHTDUER_BASE_CODING_H |
84 changes: 84 additions & 0 deletions
84
components/clouds/dueros/lightduer/include/lightduer_bitmap.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/** | ||
* Copyright (2017) Baidu Inc. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
// Author: Zhang Leliang([email protected]) | ||
// | ||
// Description: bitmap cache for fix-sized objects. | ||
|
||
#ifndef BAIDU_DUER_LIBDUER_DEVICE_FRAMEWORK_UTILS_LIGHTDUER_BITMAP_H | ||
|
||
#include "baidu_json.h" | ||
#include "lightduer_mutex.h" | ||
|
||
//#define BIT_MAP_TYPE unsigned char | ||
typedef struct bitmap_objects_s { | ||
int num_of_objs; | ||
int num_of_bitmaps; | ||
duer_mutex_t bitmap_lock; | ||
unsigned char *bitmaps; | ||
void *objects; | ||
int element_size; | ||
} bitmap_objects_t; | ||
|
||
// int dump_bitmap(bitmap_objects_t *bop, const char *tag); | ||
|
||
// int first_set_index(bitmap_objects_t *buffer); | ||
|
||
/** | ||
* init the bitmap structure | ||
* @object_num, the number of elements which will be pre-allocated | ||
* @bop, the address of the bitmap structure | ||
* @element_size, the element size of the object, in Bytes | ||
* @return, -1 fail, 0 ok | ||
*/ | ||
int init_bitmap(int object_num, bitmap_objects_t *bop, int element_size); | ||
|
||
/** | ||
* release the resource abtained in the init_bitmap | ||
* @bop, the address of the bitmap sructure | ||
* @return, -1 fail, 0 ok | ||
*/ | ||
int uninit_bitmap(bitmap_objects_t *bop); | ||
|
||
/** | ||
* allocate one element from the pre-allocated buffer in bop | ||
* @bop, the address of the bitmap structure | ||
* @return, NULL fail, the address of the element OK. | ||
*/ | ||
void *alloc_obj(bitmap_objects_t *bop); | ||
|
||
/** | ||
* free the element got by alloc_obj | ||
* @bop, the address of the bitmap structure | ||
* @obj, the address of the element got from alloc_obj | ||
* @return, 0 OK, -2 the address is not got from the buffer in bop,-1 fail, | ||
*/ | ||
int free_obj(bitmap_objects_t *bop, void *obj); | ||
|
||
/** | ||
* lock the mutex of bitmap | ||
* @bop, the address of the bitmap sructure | ||
* @return, -1 fail, 0 ok | ||
*/ | ||
int lock_bitmap(bitmap_objects_t *bop); | ||
|
||
/** | ||
* unlock the mutex of bitmap | ||
* @bop, the address of the bitmap sructure | ||
* @return, -1 fail, 0 ok | ||
*/ | ||
int unlock_bitmap(bitmap_objects_t *bop); | ||
|
||
#endif // BAIDU_DUER_LIBDUER_DEVICE_FRAMEWORK_UTILS_LIGHTDUER_BITMAP_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.