修复mico-sdk错误

This commit is contained in:
nhkefus
2025-03-11 15:54:45 +08:00
parent 3422912129
commit 2ccb892a1c
2152 changed files with 664341 additions and 702636 deletions

View File

@@ -1,42 +1,42 @@
/**
******************************************************************************
* @file dc_motor.c
* @author Eshen Wang
* @version V1.0.0
* @date 1-May-2015
* @brief dc motor operation.
******************************************************************************
* UNPUBLISHED PROPRIETARY SOURCE CODE
* Copyright (c) 2016 MXCHIP Inc.
*
* The contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of MXCHIP Corporation.
******************************************************************************
*/
#include "mico_platform.h"
#include "dc_motor.h"
#define dc_motor_log(M, ...) custom_log("DC_MOTOR", M, ##__VA_ARGS__)
#define dc_motor_log_trace() custom_log_trace("DC_MOTOR")
/*------------------------------ USER INTERFACES -----------------------------*/
int dc_motor_init(void)
{
return MicoGpioInitialize( DC_MOTOR, OUTPUT_PUSH_PULL );
}
int dc_motor_set(int value)
{
if (0 == value) {
MicoGpioOutputLow( DC_MOTOR );
}
else {
MicoGpioOutputHigh( DC_MOTOR );
}
return 0;
}
/**
******************************************************************************
* @file dc_motor.c
* @author Eshen Wang
* @version V1.0.0
* @date 1-May-2015
* @brief dc motor operation.
******************************************************************************
* UNPUBLISHED PROPRIETARY SOURCE CODE
* Copyright (c) 2016 MXCHIP Inc.
*
* The contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of MXCHIP Corporation.
******************************************************************************
*/
#include "mico_platform.h"
#include "dc_motor.h"
#define dc_motor_log(M, ...) custom_log("DC_MOTOR", M, ##__VA_ARGS__)
#define dc_motor_log_trace() custom_log_trace("DC_MOTOR")
/*------------------------------ USER INTERFACES -----------------------------*/
int dc_motor_init(void)
{
return MicoGpioInitialize( DC_MOTOR, OUTPUT_PUSH_PULL );
}
int dc_motor_set(int value)
{
if (0 == value) {
MicoGpioOutputLow( DC_MOTOR );
}
else {
MicoGpioOutputHigh( DC_MOTOR );
}
return 0;
}

View File

@@ -1,82 +1,82 @@
/**
******************************************************************************
* @file dc_motor.h
* @author Eshen Wang
* @version V1.0.0
* @date 1-May-2015
* @brief dc motor operation.
******************************************************************************
* UNPUBLISHED PROPRIETARY SOURCE CODE
* Copyright (c) 2016 MXCHIP Inc.
*
* The contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of MXCHIP Corporation.
******************************************************************************
*/
#ifndef __DC_MOTOR_H_
#define __DC_MOTOR_H_
#include "platform.h"
/** @addtogroup MICO_Drivers_interface
* @{
*/
/** @defgroup MiCO_Motor_Driver MiCO Motor Driver
* @brief Provide driver interface for Motor Devices
* @{
*/
/** @addtogroup MiCO_Motor_Driver
* @{
*/
/** @defgroup MiCO_DC_Motor_Driver MiCO DC Motor Driver
* @brief Provide driver interface for DC Motor
* @{
*/
#ifndef DC_MOTOR
#define DC_MOTOR (MICO_GPIO_NONE)
#endif
//------------------------------ user interfaces -------------------------------
/**
* @brief Initialize motor device.
*
* @return 0 : on success.
* @return error code : if an error occurred
*/
int dc_motor_init(void);
/**
* @brief Set motor state, ON or OFF.
*
* @param value: 0,motor OFF; others<72><73>motor ON
*
* @return 0 : on success.
* @return error code : if an error occurred
*/
int dc_motor_set(int value);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#endif // __DC_MOTOR_H_
/**
******************************************************************************
* @file dc_motor.h
* @author Eshen Wang
* @version V1.0.0
* @date 1-May-2015
* @brief dc motor operation.
******************************************************************************
* UNPUBLISHED PROPRIETARY SOURCE CODE
* Copyright (c) 2016 MXCHIP Inc.
*
* The contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of MXCHIP Corporation.
******************************************************************************
*/
#ifndef __DC_MOTOR_H_
#define __DC_MOTOR_H_
#include "platform.h"
/** @addtogroup MICO_Drivers_interface
* @{
*/
/** @defgroup MiCO_Motor_Driver MiCO Motor Driver
* @brief Provide driver interface for Motor Devices
* @{
*/
/** @addtogroup MiCO_Motor_Driver
* @{
*/
/** @defgroup MiCO_DC_Motor_Driver MiCO DC Motor Driver
* @brief Provide driver interface for DC Motor
* @{
*/
#ifndef DC_MOTOR
#define DC_MOTOR (MICO_GPIO_NONE)
#endif
//------------------------------ user interfaces -------------------------------
/**
* @brief Initialize motor device.
*
* @return 0 : on success.
* @return error code : if an error occurred
*/
int dc_motor_init(void);
/**
* @brief Set motor state, ON or OFF.
*
* @param value: 0,motor OFF; others<72><73>motor ON
*
* @return 0 : on success.
* @return error code : if an error occurred
*/
int dc_motor_set(int value);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#endif // __DC_MOTOR_H_

View File

@@ -1,16 +1,16 @@
#
# UNPUBLISHED PROPRIETARY SOURCE CODE
# Copyright (c) 2016 MXCHIP Inc.
#
# The contents of this file may not be disclosed to third parties, copied or
# duplicated in any form, in whole or in part, without the prior written
# permission of MXCHIP Corporation.
#
NAME := Lib_dc_motor_$(PLATFORM)
$(NAME)_SOURCES := dc_motor.c
GLOBAL_INCLUDES := .
#
# UNPUBLISHED PROPRIETARY SOURCE CODE
# Copyright (c) 2016 MXCHIP Inc.
#
# The contents of this file may not be disclosed to third parties, copied or
# duplicated in any form, in whole or in part, without the prior written
# permission of MXCHIP Corporation.
#
NAME := Lib_dc_motor_$(PLATFORM)
$(NAME)_SOURCES := dc_motor.c
GLOBAL_INCLUDES := .
#$(NAME)_CFLAGS = $(COMPILER_SPECIFIC_PEDANTIC_CFLAGS)