forked from xuos/xiuos
Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into control_framework
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
SRC_DIR := kpu tensorflow-lite
|
||||
SRC_DIR := cmsis_5 filter image_processing kpu nnom ota tensorflow-lite
|
||||
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
|
||||
8
APP_Framework/Framework/knowing/cmsis_5/Makefile
Normal file
8
APP_Framework/Framework/knowing/cmsis_5/Makefile
Normal file
@@ -0,0 +1,8 @@
|
||||
ifeq ($(CONFIG_USING_CMSIS_5),y)
|
||||
SRC_FILES := $(wildcard NN/Source/ActivationFunctions/*.c) $(wildcard NN/Source/BasicMathFunctions/*.c) $(wildcard NN/Source/ConcatenationFunctions/*.c)\
|
||||
$(wildcard NN/Source/ConvolutionFunctions/*.c) $(wildcard NN/Source/FullyConnectedFunctions/*.c) $(wildcard NN/Source/NNSupportFunctions/*.c) \
|
||||
$(wildcard NN/Source/PoolingFunctions/*.c) $(wildcard NN/Source/ReshapeFunctions/*.c) $(wildcard NN/Source/SoftmaxFunctions/*.c) $(wildcard NN/Source/SVDFunctions/*.c)
|
||||
endif
|
||||
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
@@ -1,6 +1,6 @@
|
||||
menuconfig USING_KPU_PROCESSING
|
||||
bool "kpu model processing"
|
||||
default y
|
||||
default n
|
||||
if USING_KPU_PROCESSING
|
||||
source "$APP_DIR/Framework/knowing/kpu/yolov2/Kconfig"
|
||||
source "$APP_DIR/Framework/knowing/kpu/yolov2_json/Kconfig"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
SRC_DIR := k210_yolov2_detect_procedure yolov2 yolov2_json
|
||||
SRC_DIR :=
|
||||
|
||||
ifeq ($(CONFIG_USING_KPU_PROCESSING),y)
|
||||
SRC_DIR += k210_yolov2_detect_procedure yolov2 yolov2_json
|
||||
endif
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
|
||||
6
APP_Framework/Framework/knowing/nnom/Makefile
Normal file
6
APP_Framework/Framework/knowing/nnom/Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
SRC_DIR :=
|
||||
ifeq ($(CONFIG_USING_NNOM),y)
|
||||
SRC_FILES := $(wildcard src/backends/*.c) $(wildcard src/core/*.c) $(wildcard src/layers/*.c)
|
||||
endif
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
@@ -45,7 +45,7 @@ nnom_layer_t *reshape_s(const nnom_reshape_config_t *config)
|
||||
|
||||
// config
|
||||
//nnom_memcpy(layer->dim, config->dim, config->num_dim * sizeof(nnom_shape_data_t));
|
||||
layer->super.config = config;
|
||||
layer->super.config = (void*)config;
|
||||
layer->dim = config->dim; // temporary use the config directly. (not preferable.)
|
||||
layer->num_dim = config->num_dim;
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
SRC_DIR := tensorflow-lite-for-mcu
|
||||
SRC_DIR :=
|
||||
|
||||
ifeq ($(CONFIG_USING_TENSORFLOWLITEMICRO),y)
|
||||
SRC_DIR += tensorflow-lite-for-mcu
|
||||
endif
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
|
||||
@@ -69,6 +69,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef ADD_XIZI_FETURES
|
||||
static int PinOpen(void){
|
||||
int pin_fd = PrivOpen(SENSOR_DEVICE_QS_FX_PIN_DEV, O_RDWR);
|
||||
if (pin_fd < 0) {
|
||||
@@ -95,6 +96,7 @@ static int PinOpen(void){
|
||||
|
||||
return pin_fd;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @description: Read sensor device
|
||||
@@ -104,22 +106,26 @@ static int PinOpen(void){
|
||||
*/
|
||||
static int SensorDeviceRead(struct SensorDevice *sdev, size_t len)
|
||||
{
|
||||
#ifdef ADD_XIZI_FETURES
|
||||
int pin_fd=PinOpen();
|
||||
struct PinStat pin_dir;
|
||||
pin_dir.pin = SENSOR_DEVICE_QS_FX_PIN_NUMBER;
|
||||
|
||||
pin_dir.val = GPIO_HIGH;
|
||||
if (PrivWrite(pin_fd,&pin_dir,0) < 0) // pull-up pin to configure as tx mode
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
PrivTaskDelay(20);
|
||||
if (PrivWrite(sdev->fd, instructions, sizeof(instructions)) < 0)
|
||||
return -1;
|
||||
|
||||
PrivTaskDelay(20);
|
||||
|
||||
#ifdef ADD_XIZI_FETURES
|
||||
pin_dir.val = GPIO_LOW;
|
||||
if (PrivWrite(pin_fd,&pin_dir,0) < 0) // pull-down pin to configure as rx mode
|
||||
return -1;
|
||||
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
if (PrivRead(sdev->fd, sdev->buffer, len) < 0)
|
||||
return -1;
|
||||
PrivClose(pin_fd);
|
||||
|
||||
@@ -68,7 +68,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#ifdef ADD_XIZI_FETURES
|
||||
static int PinOpen(void){
|
||||
int pin_fd = PrivOpen(SENSOR_DEVICE_QS_FS_PIN_DEV, O_RDWR);
|
||||
if (pin_fd < 0) {
|
||||
@@ -96,6 +96,8 @@ static int PinOpen(void){
|
||||
return pin_fd;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @description: Read sensor device
|
||||
* @param sdev - sensor device pointer
|
||||
@@ -104,6 +106,7 @@ static int PinOpen(void){
|
||||
*/
|
||||
static int SensorDeviceRead(struct SensorDevice *sdev, size_t len)
|
||||
{
|
||||
#ifdef ADD_XIZI_FETURES
|
||||
int pin_fd=PinOpen();
|
||||
struct PinStat pin_dir;
|
||||
pin_dir.pin = SENSOR_DEVICE_QS_FS_PIN_NUMBER;
|
||||
@@ -111,16 +114,19 @@ static int SensorDeviceRead(struct SensorDevice *sdev, size_t len)
|
||||
pin_dir.val = GPIO_HIGH;
|
||||
if (PrivWrite(pin_fd,&pin_dir,0) < 0) // pull-up pin to configure as tx mode
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
PrivTaskDelay(20);
|
||||
if (PrivWrite(sdev->fd, instructions, sizeof(instructions)) < 0)
|
||||
return -1;
|
||||
PrivTaskDelay(20);
|
||||
|
||||
|
||||
#ifdef ADD_XIZI_FETURES
|
||||
pin_dir.val = GPIO_LOW;
|
||||
if (PrivWrite(pin_fd,&pin_dir,0) < 0) // pull-down pin to configure as rx mode
|
||||
return -1;
|
||||
|
||||
#endif
|
||||
|
||||
if (PrivRead(sdev->fd, sdev->buffer, len) < 0)
|
||||
return -1;
|
||||
|
||||
@@ -128,6 +134,7 @@ static int SensorDeviceRead(struct SensorDevice *sdev, size_t len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static struct SensorDone done =
|
||||
{
|
||||
SensorDeviceOpen,
|
||||
|
||||
@@ -172,6 +172,9 @@ int PrivIoctl(int fd, int cmd, void *args)
|
||||
case WDT_TYPE:
|
||||
case CAMERA_TYPE:
|
||||
case KPU_TYPE:
|
||||
case TIME_TYPE:
|
||||
case FLASH_TYPE:
|
||||
case CAN_TYPE:
|
||||
ret = ioctl(fd, cmd, ioctl_cfg->args);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -151,7 +151,10 @@ enum IoctlDriverType
|
||||
WDT_TYPE,
|
||||
RTC_TYPE,
|
||||
CAMERA_TYPE,
|
||||
CAN_TYPE,
|
||||
KPU_TYPE,
|
||||
FLASH_TYPE,
|
||||
TIME_TYPE,
|
||||
DEFAULT_TYPE,
|
||||
};
|
||||
|
||||
@@ -252,6 +255,25 @@ enum TCP_OPTION {
|
||||
RECV_DATA,
|
||||
};
|
||||
|
||||
struct CanDriverConfigure
|
||||
{
|
||||
uint8 tsjw;
|
||||
uint8 tbs2 ;
|
||||
uint8 tbs1;
|
||||
uint8 mode;
|
||||
uint16 brp;
|
||||
};
|
||||
|
||||
struct CanSendConfigure
|
||||
{
|
||||
uint32 stdid;
|
||||
uint32 exdid;
|
||||
uint8 ide;
|
||||
uint8 rtr;
|
||||
uint8 data_lenth;
|
||||
uint8 *data;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t *buffer;
|
||||
|
||||
Reference in New Issue
Block a user