mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-16 15:08:15 +08:00
修改了Web后台的部分界面,增加了HAmqtt中的总电量传感器,后台新增mqtt上报频率设置
This commit is contained in:
72
mico-os/platform/EWARM/Retarget.c
Normal file
72
mico-os/platform/EWARM/Retarget.c
Normal file
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file Retarget.c
|
||||
* @author William Xu
|
||||
* @version V1.0.0
|
||||
* @date 05-May-2014
|
||||
******************************************************************************
|
||||
*
|
||||
* 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 <stdlib.h>
|
||||
#include <yfuns.h>
|
||||
#include "platform.h"
|
||||
#include "platform_config.h"
|
||||
#include "mico_platform.h"
|
||||
|
||||
#if defined (MOC) && ( MOC == 1 )
|
||||
#include "moc_api.h"
|
||||
extern mico_api_t *lib_api_p;
|
||||
/* memory management*/
|
||||
void* _malloc(size_t size)
|
||||
{
|
||||
return lib_api_p->malloc(size);
|
||||
} // malloc
|
||||
void* _realloc(void* pv, size_t size)
|
||||
{
|
||||
return lib_api_p->realloc(pv, size);
|
||||
} // realloc
|
||||
void _free(void* pv)
|
||||
{
|
||||
lib_api_p->free(pv);
|
||||
} //free
|
||||
void* _calloc(size_t a, size_t b)
|
||||
{
|
||||
return lib_api_p->calloc(a, b);
|
||||
} // calloc
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef BOOTLOADER
|
||||
int putchar(int ch)
|
||||
{
|
||||
MicoUartSend( STDIO_UART, &ch, 1 );
|
||||
return ch;
|
||||
}
|
||||
#else
|
||||
#if (!defined CONFIG_PLATFORM_8195A) || (defined MOC100)
|
||||
size_t __write( int handle, const unsigned char * buffer, size_t size )
|
||||
{
|
||||
UNUSED_PARAMETER(handle);
|
||||
|
||||
if ( buffer == 0 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef MICO_DISABLE_STDIO
|
||||
MicoUartSend( STDIO_UART, (const char*)buffer, size );
|
||||
#endif
|
||||
|
||||
return size;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
27
mico-os/platform/EWARM/close.c
Normal file
27
mico-os/platform/EWARM/close.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/*******************
|
||||
*
|
||||
* Copyright 1998-2010 IAR Systems AB.
|
||||
*
|
||||
* This is a template implementation of the "__close" function used by
|
||||
* the standard library. Replace it with a system-specific
|
||||
* implementation.
|
||||
*
|
||||
* The "__close" function should close the file corresponding to
|
||||
* "handle". It should return 0 on success and nonzero on failure.
|
||||
*
|
||||
********************/
|
||||
|
||||
#include <yfuns.h>
|
||||
|
||||
_STD_BEGIN
|
||||
|
||||
#pragma module_name = "?__close"
|
||||
|
||||
#pragma diag_suppress = Pe826
|
||||
|
||||
int __close(int handle)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
_STD_END
|
||||
37
mico-os/platform/EWARM/lseek.c
Normal file
37
mico-os/platform/EWARM/lseek.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*******************
|
||||
*
|
||||
* Copyright 1998-2010 IAR Systems AB.
|
||||
*
|
||||
* This is a template implementation of the "__lseek" function used by
|
||||
* the standard library. Replace it with a system-specific
|
||||
* implementation.
|
||||
*
|
||||
* The "__lseek" function makes the next file operation (__read or
|
||||
* __write) act on a new location. The parameter "whence" specifies
|
||||
* how the "offset" parameter should be interpreted according to the
|
||||
* following table:
|
||||
*
|
||||
* 0 (=SEEK_SET) - Goto location "offset".
|
||||
* 1 (=SEEK_CUR) - Go "offset" bytes from the current location.
|
||||
* 2 (=SEEK_END) - Go to "offset" bytes from the end.
|
||||
*
|
||||
* This function should return the current file position, or -1 on
|
||||
* failure.
|
||||
*
|
||||
********************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <yfuns.h>
|
||||
|
||||
_STD_BEGIN
|
||||
|
||||
#pragma module_name = "?__lseek"
|
||||
|
||||
#pragma diag_suppress = Pe826
|
||||
|
||||
long __lseek(int handle, long offset, int whence)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
_STD_END
|
||||
74
mico-os/platform/EWARM/platform_toolchain.h
Normal file
74
mico-os/platform/EWARM/platform_toolchain.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* 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 INCLUDED_WWD_TOOLCHAIN_H
|
||||
#define INCLUDED_WWD_TOOLCHAIN_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/******************************************************
|
||||
* Macros
|
||||
******************************************************/
|
||||
#ifndef WEAK
|
||||
#define WEAK __weak
|
||||
#endif
|
||||
|
||||
#ifndef ALWAYS_INLINE
|
||||
#define ALWAYS_INLINE
|
||||
#endif
|
||||
|
||||
#ifndef USED
|
||||
#define USED __root
|
||||
#endif
|
||||
|
||||
#ifndef MAY_BE_UNUSED
|
||||
#define MAY_BE_UNUSED
|
||||
#endif
|
||||
|
||||
#ifndef NORETURN
|
||||
#define NORETURN
|
||||
#endif
|
||||
|
||||
/******************************************************
|
||||
* Constants
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Enumerations
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Type Definitions
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Structures
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Global Variables
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Function Declarations
|
||||
******************************************************/
|
||||
//void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen );
|
||||
void *memrchr( const void *s, int c, size_t n );
|
||||
void iar_set_msp(void*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
#endif /* #ifndef INCLUDED_WWD_TOOLCHAIN_H */
|
||||
27
mico-os/platform/EWARM/remove.c
Normal file
27
mico-os/platform/EWARM/remove.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/*******************
|
||||
*
|
||||
* Copyright 1998-2010 IAR Systems AB.
|
||||
*
|
||||
* This is a template implementation of the "remove" function of the
|
||||
* standard library. Replace it with a system-specific
|
||||
* implementation.
|
||||
*
|
||||
* The "remove" function should remove the file named "filename". It
|
||||
* should return 0 on success and nonzero on failure.
|
||||
*
|
||||
********************/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
_STD_BEGIN
|
||||
|
||||
#pragma module_name = "?remove"
|
||||
|
||||
#pragma diag_suppress = Pe826
|
||||
|
||||
int remove(const char * filename)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
_STD_END
|
||||
Reference in New Issue
Block a user