更新M12-04P
This commit is contained in:
parent
abce486b2b
commit
35585f46bc
144
app/DataFlash/pfdl.h
Normal file
144
app/DataFlash/pfdl.h
Normal file
@ -0,0 +1,144 @@
|
||||
/*******************************************************************************
|
||||
* Library : Flash Data Library T04 (PicoFDL)
|
||||
*
|
||||
* File Name : $Source: pfdl.h $
|
||||
* Lib. Version : $RL78_FDL_LIB_VERSION_T04_REN: V1.05 $
|
||||
* Mod. Revision : $Revision: 1.8 $
|
||||
* Mod. Date : $Date: 2013/06/10 22:04:41JST $
|
||||
* Device(s) : RL78
|
||||
* Description : C language API definition of the Flash Data Library
|
||||
*******************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only
|
||||
* intended for use with Renesas products. No other uses are authorized. This
|
||||
* software is owned by Renesas Electronics Corporation and is protected under
|
||||
* all applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
|
||||
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
|
||||
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
|
||||
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
|
||||
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
|
||||
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software
|
||||
* and to discontinue the availability of this software. By using this software,
|
||||
* you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2011-2013 Renesas Electronics Corporation. All rights reserved.
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef __PFDL_H_INCLUDED
|
||||
#define __PFDL_H_INCLUDED
|
||||
|
||||
/*================================================================================================*/
|
||||
/* include files list */
|
||||
/*================================================================================================*/
|
||||
#include "pfdl_types.h"
|
||||
|
||||
#define FLASH_START_ADDRESS (0xF1000) /* Start address of data flash */
|
||||
#define TARGET_BLOCK (0) /* Block number of target(0 ~ 3) */
|
||||
#define BLOCK_SIZE (0x400) /* Block size */
|
||||
//#define WRITE_SIZE (1) /* Size of data to be written at once */
|
||||
#define MAX_VALUE (0xFF) /* Maximum value of writing */
|
||||
#define MAX_ADDRESS ((TARGET_BLOCK + 1) * BLOCK_SIZE - 1) /* Maximum address of writing */
|
||||
#define PFDL_NG (1) /* Failure to Data Flash */
|
||||
#define FDL_FRQ (32) /* Setting frequency (MHz) */
|
||||
#define FDL_VOL (0x00) /* Voltage mode */
|
||||
|
||||
uint8_t WriteDataflash(uint8_t* buffer,uint32_t Addr,uint16_t lenth);
|
||||
uint8_t WriteDataflash1(uint8_t* buffer,uint32_t Addr,uint16_t lenth);
|
||||
|
||||
void ReadFlashData(uint8_t* buffer,uint32_t Addr,uint16_t lenth);
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
/* Block type: standard function */
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
/* Purpose: Unconditional activation of the Data Flash Library. */
|
||||
/* Based on the descriptor data: */
|
||||
/* - the flash firmware will be initialized for data-flash access only */
|
||||
/* - the internal timing and low-voltage capability will be configured according to the descriptor */
|
||||
/* After successful initialization the data flash clock is ON and the PFDL is ready to use. */
|
||||
/* */
|
||||
/* CAUTION: */
|
||||
/* Due to the code size minimization no plausibility checks are done by the PicoFDL. */
|
||||
/* Neither configuration, frequency range nor data flash size will be checked by the library. */
|
||||
/* */
|
||||
/* Input: address of the PFDL descriptor variable (RAM only) */
|
||||
/* Output: - */
|
||||
/* Return: PFDL status */
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
extern pfdl_status_t __far PFDL_Open(__near pfdl_descriptor_t* descriptor_pstr);
|
||||
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
/* Block type: standard function */
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
/* Purpose: Disable data flash access unconditionally. */
|
||||
/* If any command is just executed, PFDL_Close will stop it immediately. */
|
||||
/* After return the data flash clock is switched OFF. */
|
||||
/* Input: - */
|
||||
/* Output: - */
|
||||
/* Return: - */
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
extern void __far PFDL_Close(void);
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
/* Block type: standard function */
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
/* Purpose: Initiating execution of the PFDL request related to the data flash. */
|
||||
/* The corresponding request variable has to be parametrized before. */
|
||||
/* */
|
||||
/* request_pstr->index_u16 : byte-index or block-number within PFDL-pool */
|
||||
/* request_pstr->data_pu08 : start address of the RAM data that should be read/written */
|
||||
/* request_pstr->bytecount_u16 : number of bytes has to be read/written */
|
||||
/* request_pstr->command_enu : command code */
|
||||
/* */
|
||||
/* CAUTION: */
|
||||
/* Due to the code size minimization no plausibility checks are done by the PFDL. */
|
||||
/* */
|
||||
/* Input: &request_pstr - pointer to PFDL request variable */
|
||||
/* Output: - */
|
||||
/* Return: status of the request */
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
extern pfdl_status_t __far PFDL_Execute(__near pfdl_request_t* request_pstr);
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
/* Block type: standard function */
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
/* Purpose: Continuation of command execution and status update of requests being under execution. */
|
||||
/* Input: - */
|
||||
/* Output: - */
|
||||
/* Return: PFDL status = */
|
||||
/* PFDL_IDLE - no request is processed by PFDL, PFDL is ready to receive new requests */
|
||||
/* PFDL_OK - processed request/command finished without problems */
|
||||
/* PFDL_BUSY - request/command is still being processed */
|
||||
/* other - flash or firmware related errors */
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
extern pfdl_status_t __far PFDL_Handler(void);
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
/* Block type: standard function */
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
/* Purpose: Returns the start address of the library version string */
|
||||
/* */
|
||||
/* Input: - */
|
||||
/* Output: - */
|
||||
/* Return: starting address of the zero-terminated version string */
|
||||
/* ---------------------------------------------------------------------------------------------------------------*/
|
||||
extern __far pfdl_u08* __far PFDL_GetVersionString(void);
|
||||
|
||||
|
||||
|
||||
#endif
|
BIN
app/DataFlash/pfdl.lib
Normal file
BIN
app/DataFlash/pfdl.lib
Normal file
Binary file not shown.
146
app/DataFlash/pfdl_types.h
Normal file
146
app/DataFlash/pfdl_types.h
Normal file
@ -0,0 +1,146 @@
|
||||
/*******************************************************************************
|
||||
* Library : Flash Data Library T04 (PicoFDL)
|
||||
*
|
||||
* File Name : $Source: pfdl_types.h $
|
||||
* Lib. Version : $RL78_FDL_LIB_VERSION_T04_REN: V1.05 $
|
||||
* Mod. Revision : $Revision: 1.8 $
|
||||
* Mod. Date : $Date: 2013/06/10 22:28:01JST $
|
||||
* Device(s) : RL78
|
||||
* Description : Type definitions used by the library
|
||||
*******************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only
|
||||
* intended for use with Renesas products. No other uses are authorized. This
|
||||
* software is owned by Renesas Electronics Corporation and is protected under
|
||||
* all applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
|
||||
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
|
||||
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
|
||||
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
|
||||
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
|
||||
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software
|
||||
* and to discontinue the availability of this software. By using this software,
|
||||
* you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2011-2013 Renesas Electronics Corporation. All rights reserved.
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef __PFDL_TYPES_H_INCLUDED
|
||||
#define __PFDL_TYPES_H_INCLUDED
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef __TYPEDEF__
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed long int32_t;
|
||||
typedef unsigned long uint32_t;
|
||||
typedef unsigned short MD_STATUS;
|
||||
#define __TYPEDEF__
|
||||
#endif
|
||||
/*==============================================================================================*/
|
||||
/* unsigned type definitions */
|
||||
/*==============================================================================================*/
|
||||
typedef unsigned char pfdl_u08;
|
||||
typedef unsigned int pfdl_u16;
|
||||
typedef unsigned long int pfdl_u32;
|
||||
|
||||
|
||||
/*==============================================================================================*/
|
||||
/* global constant definitions */
|
||||
/*==============================================================================================*/
|
||||
|
||||
|
||||
|
||||
/*==============================================================================================*/
|
||||
/* global type definitions */
|
||||
/*==============================================================================================*/
|
||||
|
||||
|
||||
/* PFDL command code set */
|
||||
typedef enum
|
||||
{ /* ---------------------------------------------- */
|
||||
PFDL_CMD_READ_BYTES = (0x00), /* 0x00, reads data from flash memory */
|
||||
PFDL_CMD_IVERIFY_BYTES = (0x06), /* 0x06, verifies data if flash content is stable */
|
||||
PFDL_CMD_BLANKCHECK_BYTES = (0x08), /* 0x08, checks if flash content is blank */
|
||||
PFDL_CMD_WRITE_BYTES = (0x04), /* 0x04, writes data into flash memory */
|
||||
PFDL_CMD_ERASE_BLOCK = (0x03) /* 0x03, erases one flash block */
|
||||
} pfdl_command_t; /* ---------------------------------------------- */
|
||||
|
||||
|
||||
/* PFDL error code set */
|
||||
typedef enum
|
||||
{
|
||||
/* operation related status */ /* ---------------------------------------------- */
|
||||
PFDL_IDLE = (0x30), /* 0x30, PFDL ready to receive requests */
|
||||
PFDL_OK = (0x00), /* 0x00, command finished without problems */
|
||||
PFDL_BUSY = (0xFF), /* 0xFF, command is being processed */
|
||||
/* flash related status */ /* ---------------------------------------------- */
|
||||
PFDL_ERR_PROTECTION = (0x10), /* 0x10, protection error (access right conflict) */
|
||||
PFDL_ERR_ERASE = (0x1A), /* 0x1A, erase error */
|
||||
PFDL_ERR_MARGIN = (0x1B), /* 0x1B, blankcheck or verify margin violated */
|
||||
PFDL_ERR_WRITE = (0x1C), /* 0x1C, write error */
|
||||
PFDL_ERR_PARAMETER = (0x05) /* 0x05, parameter error */
|
||||
} pfdl_status_t; /* ---------------------------------------------- */
|
||||
|
||||
|
||||
/* PFDL request type (base type for any PFDL access) */
|
||||
typedef struct
|
||||
{ /* ---------------------------------------------- */
|
||||
pfdl_u16 index_u16; /* 2, W, virt. byte/block index inside PFDL-pool */
|
||||
__near pfdl_u08* data_pu08; /* 2, W, pointer to the 1'st byte of data buffer */
|
||||
pfdl_u16 bytecount_u16; /* 2, W, number of bytes to be transfered */
|
||||
pfdl_command_t command_enu; /* 1, W, command code */
|
||||
} pfdl_request_t; /*------------------------------------------------*/
|
||||
/* 7 bytes in total */
|
||||
/*------------------------------------------------*/
|
||||
|
||||
/* PFDL descriptor type */
|
||||
typedef struct
|
||||
{ /* ---------------------------------------------- */
|
||||
pfdl_u08 fx_MHz_u08; /* 1, system frequency expressed in MHz */
|
||||
pfdl_u08 wide_voltage_mode_u08; /* 1, programming voltage mode ( full/wide ) */
|
||||
} pfdl_descriptor_t; /*------------------------------------------------*/
|
||||
/* 2 bytes in total */
|
||||
|
||||
|
||||
/*==============================================================================================*/
|
||||
/* type definition plausibility check */
|
||||
/*==============================================================================================*/
|
||||
|
||||
/* The following checks are implemented in order to check the correct size of the FDL type */
|
||||
/* definitions at compile time. In case of a compilation error in the following lines, please */
|
||||
/* check your compiler options for enumeration types and structures and contact your local */
|
||||
/* support, if necessary. */
|
||||
|
||||
#define R_PFDLT04_ASSERT_CONCAT_(a, b) a##b
|
||||
#define R_PFDLT04_ASSERT_CONCAT(a, b) R_PFDLT04_ASSERT_CONCAT_(a, b)
|
||||
#define R_PFDLT04_STATIC_ASSERT(e) enum { R_PFDLT04_ASSERT_CONCAT(R_PFDLT04_ASSERT_LINE_, __LINE__) = 1/(!!(e)) }
|
||||
|
||||
|
||||
/* assertion if unsigned data type size is not correct, please evaluate compiler settings for integer types */
|
||||
R_PFDLT04_STATIC_ASSERT(sizeof(pfdl_u08)==1);
|
||||
R_PFDLT04_STATIC_ASSERT(sizeof(pfdl_u16)==2);
|
||||
R_PFDLT04_STATIC_ASSERT(sizeof(pfdl_u32)==4);
|
||||
|
||||
/* assertion if unsigned data type size is not correct, please evaluate compiler settings for enumeration types */
|
||||
R_PFDLT04_STATIC_ASSERT(sizeof(pfdl_command_t)==1);
|
||||
R_PFDLT04_STATIC_ASSERT(sizeof(pfdl_status_t)==1);
|
||||
|
||||
/* assertion if structure type size is not correct, please evaluate compiler settings for structure types */
|
||||
R_PFDLT04_STATIC_ASSERT(sizeof(pfdl_request_t)>=7); /* sizeof(pfdl_request_t) == 7 for packed structures */
|
||||
R_PFDLT04_STATIC_ASSERT(sizeof(pfdl_request_t)<=8); /* sizeof(pfdl_request_t) == 8 for unpacked structures */
|
||||
R_PFDLT04_STATIC_ASSERT(sizeof(pfdl_descriptor_t)==2);
|
||||
|
||||
|
||||
#endif
|
303
app/DataFlash/r_pfdl.c
Normal file
303
app/DataFlash/r_pfdl.c
Normal file
@ -0,0 +1,303 @@
|
||||
|
||||
|
||||
#include "r_cg_macrodriver.h"
|
||||
|
||||
#include "pfdl.h"
|
||||
#include "pfdl_types.h"
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function Name: WriteDataflash
|
||||
* Description :
|
||||
* Arguments : buffer: to be writed data; Addr:Target absolute address,must be check for different mcu;lenth:to be writed number,<=1024
|
||||
* Return Value : PFDL_OK -
|
||||
Success
|
||||
PFDL_IDLE -
|
||||
Idling statement
|
||||
PFDL_ERR_MARGIN -
|
||||
Blank check error
|
||||
|
||||
other//if(Addr>=FLASH_START_ADDRESS&&Addr<FLASH_END_ADDRESS){
|
||||
***********************************************************************************************************************/
|
||||
uint8_t WriteDataflash(uint8_t* buffer,uint32_t Addr,uint16_t lenth)
|
||||
{
|
||||
static unsigned char Wr_Status;
|
||||
pfdl_status_t ret;
|
||||
pfdl_descriptor_t descriptor;
|
||||
pfdl_request_t requester;
|
||||
|
||||
if(Addr>=0x000F1000 && Addr<0x000F2000)
|
||||
{
|
||||
if(Wr_Status == 0)
|
||||
{
|
||||
/* ---- Setting for PFDL_Open ---- */
|
||||
descriptor.fx_MHz_u08 = FDL_FRQ;
|
||||
descriptor.wide_voltage_mode_u08 = FDL_VOL;
|
||||
PFDL_Open(&descriptor);
|
||||
|
||||
/* ---- Setting for blank check ---- */
|
||||
requester.command_enu = PFDL_CMD_BLANKCHECK_BYTES;
|
||||
requester.index_u16 = (unsigned int)(Addr - 0x0F1000);//g_write_address;0x0F1000 according to MCU
|
||||
requester.bytecount_u16 = lenth;
|
||||
ret = PFDL_Execute(&requester); /* Blank check */
|
||||
Wr_Status = 1;
|
||||
}
|
||||
|
||||
if(Wr_Status == 1)
|
||||
{
|
||||
/* ---- Waiting for command finish ---- */
|
||||
while(ret == PFDL_BUSY)
|
||||
{
|
||||
ret = PFDL_Handler(); /* Status check process */
|
||||
}
|
||||
if(ret != PFDL_BUSY)
|
||||
{
|
||||
/* **** When blank check error **** */
|
||||
if(ret == PFDL_ERR_MARGIN)
|
||||
{
|
||||
|
||||
/* ---- Setting for erase ---- */
|
||||
requester.command_enu = PFDL_CMD_ERASE_BLOCK;
|
||||
requester.index_u16 = (unsigned int)(Addr - 0x0F1000)/0x400;//TARGET_BLOCK;
|
||||
ret = PFDL_Execute(&requester); /* Erase block data */
|
||||
Wr_Status = 2;
|
||||
/* Erase data of target block */
|
||||
}
|
||||
/* **** When other than blank check error **** */
|
||||
else
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
|
||||
/******When blank no check error***/
|
||||
if(ret == PFDL_OK)
|
||||
{
|
||||
/* ---- Setting for write ---- */
|
||||
requester.command_enu = PFDL_CMD_WRITE_BYTES;
|
||||
requester.index_u16 = (unsigned int)(Addr - 0x0F1000);//g_write_address;;
|
||||
requester.bytecount_u16 = lenth;
|
||||
requester.data_pu08 = buffer;//&g_write_value;
|
||||
ret = PFDL_Execute(&requester); /* Execute write */
|
||||
Wr_Status = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(Wr_Status == 2)
|
||||
{
|
||||
/* ---- Waiting for command finish ---- */
|
||||
while(ret == PFDL_BUSY)
|
||||
{
|
||||
ret = PFDL_Handler(); /* Status check process */
|
||||
}
|
||||
if(ret != PFDL_BUSY)
|
||||
{
|
||||
if(ret == PFDL_OK)
|
||||
{
|
||||
/* ---- Setting for write ---- */
|
||||
requester.command_enu = PFDL_CMD_WRITE_BYTES;
|
||||
requester.index_u16 = (unsigned int)(Addr - 0x0F1000);//g_write_address;;
|
||||
requester.bytecount_u16 = lenth;
|
||||
requester.data_pu08 = buffer;//&g_write_value;
|
||||
ret = PFDL_Execute(&requester); /* Execute write */
|
||||
Wr_Status = 3;
|
||||
}
|
||||
/* **** When blank check or data erase is failure **** */
|
||||
else
|
||||
{
|
||||
ret = PFDL_NG;
|
||||
//PFDL_Close(); /* Close FDL */
|
||||
//Wr_Status = 0;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(Wr_Status == 3)
|
||||
{
|
||||
/* ---- Waiting for command finish ---- */
|
||||
while(ret == PFDL_BUSY)
|
||||
{
|
||||
ret = PFDL_Handler(); /* Status check process */
|
||||
}
|
||||
if(ret != PFDL_BUSY)
|
||||
{
|
||||
/* ==== When write data is success ==== */
|
||||
if(ret == PFDL_OK)
|
||||
{
|
||||
/* ---- Setting for verify ---- */
|
||||
requester.command_enu = PFDL_CMD_IVERIFY_BYTES;
|
||||
requester.index_u16 = (unsigned int)(Addr- 0x0F1000);//g_write_address;;
|
||||
requester.bytecount_u16 = lenth;
|
||||
ret = PFDL_Execute(&requester); /* Execute internal verify */
|
||||
Wr_Status = 4;
|
||||
}
|
||||
/* ==== When writing data is failure ==== */
|
||||
else
|
||||
{
|
||||
ret = PFDL_NG;
|
||||
//PFDL_Close(); /* Close FDL */
|
||||
//Wr_Status = 0;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(Wr_Status == 4)
|
||||
{
|
||||
/* ---- Waiting for command finish ---- */
|
||||
while(ret == PFDL_BUSY)
|
||||
{
|
||||
ret = PFDL_Handler(); /* Status check process */
|
||||
}
|
||||
if(ret != PFDL_BUSY)
|
||||
{
|
||||
PFDL_Close(); /* Close FDL */
|
||||
Wr_Status = 0;
|
||||
return 0x11;//write data flash finished
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = PFDL_NG;
|
||||
Wr_Status = 0;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint8_t WriteDataflash1(uint8_t* buffer,uint32_t Addr,uint16_t lenth)
|
||||
{
|
||||
pfdl_status_t ret;
|
||||
pfdl_descriptor_t descriptor;
|
||||
pfdl_request_t requester;
|
||||
|
||||
if(Addr>=0x000F1000&&Addr<0x000F2000){
|
||||
/* ---- Setting for PFDL_Open ---- */
|
||||
descriptor.fx_MHz_u08 = FDL_FRQ;
|
||||
descriptor.wide_voltage_mode_u08 = FDL_VOL;
|
||||
PFDL_Open(&descriptor);
|
||||
|
||||
/* ---- Setting for blank check ---- */
|
||||
requester.command_enu = PFDL_CMD_BLANKCHECK_BYTES;
|
||||
requester.index_u16 = (unsigned int)(Addr - 0x0F1000);//g_write_address;0x0F1000 according to MCU
|
||||
requester.bytecount_u16 = lenth;
|
||||
ret = PFDL_Execute(&requester); /* Blank check */
|
||||
|
||||
/* ---- Waiting for command finish ---- */
|
||||
while(ret == PFDL_BUSY)
|
||||
{
|
||||
ret = PFDL_Handler(); /* Status check process */
|
||||
}
|
||||
|
||||
/* **** When blank check error **** */
|
||||
if(ret == PFDL_ERR_MARGIN)
|
||||
{
|
||||
|
||||
/* ---- Setting for erase ---- */
|
||||
requester.command_enu = PFDL_CMD_ERASE_BLOCK;
|
||||
requester.index_u16 = (unsigned int)(Addr - 0x0F1000)/0x400;//TARGET_BLOCK;
|
||||
ret = PFDL_Execute(&requester); /* Erase block data */
|
||||
|
||||
/* ---- Waiting for command finish ---- */
|
||||
while(ret == PFDL_BUSY)
|
||||
{
|
||||
ret = PFDL_Handler(); /* Status check process */
|
||||
} /* Erase data of target block */
|
||||
}
|
||||
/* **** When other than blank check error **** */
|
||||
else
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
|
||||
if(ret == PFDL_OK)
|
||||
{
|
||||
/* ---- Setting for write ---- */
|
||||
requester.command_enu = PFDL_CMD_WRITE_BYTES;
|
||||
requester.index_u16 = (unsigned int)(Addr - 0x0F1000);//g_write_address;;
|
||||
requester.bytecount_u16 = lenth;
|
||||
requester.data_pu08 = buffer;//&g_write_value;
|
||||
ret = PFDL_Execute(&requester); /* Execute write */
|
||||
|
||||
/* ---- Waiting for command finish ---- */
|
||||
while(ret == PFDL_BUSY)
|
||||
{
|
||||
ret = PFDL_Handler(); /* Status check process */
|
||||
} /* Write data process */
|
||||
/* ==== When write data is success ==== */
|
||||
|
||||
if(ret == PFDL_OK)
|
||||
{
|
||||
/* ---- Setting for verify ---- */
|
||||
requester.command_enu = PFDL_CMD_IVERIFY_BYTES;
|
||||
requester.index_u16 = (unsigned int)(Addr- 0x0F1000);//g_write_address;;
|
||||
requester.bytecount_u16 = lenth;
|
||||
ret = PFDL_Execute(&requester); /* Execute internal verify */
|
||||
|
||||
/* ---- Waiting for command finish ---- */
|
||||
while(ret == PFDL_BUSY)
|
||||
{
|
||||
ret = PFDL_Handler();/* Status check process */
|
||||
}
|
||||
|
||||
}
|
||||
/* ==== When writing data is failure ==== */
|
||||
else
|
||||
{
|
||||
ret = PFDL_NG;
|
||||
}
|
||||
}
|
||||
/* **** When blank check or data erase is failure **** */
|
||||
else
|
||||
{
|
||||
ret = PFDL_NG;
|
||||
}
|
||||
|
||||
PFDL_Close(); /* Close FDL */
|
||||
|
||||
return ret;
|
||||
}
|
||||
else{
|
||||
ret = PFDL_NG;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function Name: ReadFlashData
|
||||
* Description :
|
||||
* Arguments : buffer: to be read data;
|
||||
Addr:Target absolute address,must be check for different mcu; Both codeflash & dataflash can be used
|
||||
lenth:to be read number
|
||||
* Return Value : None
|
||||
***********************************************************************************************************************/
|
||||
|
||||
void ReadFlashData(uint8_t* buffer,uint32_t Addr,uint16_t lenth)
|
||||
{
|
||||
uint8_t temp;
|
||||
volatile uint32_t w_count;
|
||||
volatile uint8_t * snnumber;
|
||||
/**** Only dataflash needed start*****/
|
||||
if(0 == DFLEN)
|
||||
{
|
||||
DFLEN = 1U; //允许存取数据闪存
|
||||
for (w_count = 0U; w_count < 15U; w_count++)//3U
|
||||
{
|
||||
NOP(); //延时,给硬件反应的时间
|
||||
}
|
||||
}
|
||||
/**** Only dataflash needed end******/
|
||||
snnumber = Addr;
|
||||
|
||||
for(temp = 0; temp < lenth; temp ++)
|
||||
{
|
||||
*buffer = *snnumber;
|
||||
buffer ++;
|
||||
snnumber ++;
|
||||
}
|
||||
//memcpy(buffer,snnumber,lenth);
|
||||
}
|
||||
|
||||
/* End user code. Do not edit comment generated here */
|
10
app/DataFlash/测试数据.txt
Normal file
10
app/DataFlash/测试数据.txt
Normal file
@ -0,0 +1,10 @@
|
||||
内振32MHz
|
||||
|
||||
擦除 64Bytes和1024Bytes个00H,时间一样,为5.7mS
|
||||
写入 1024Bytes个00H 需要46.8mS,写入时间和数据长度成线性关系
|
||||
|
||||
T04库的使用注意事项:
|
||||
1,栈,传参,DMA对应的RAM地址都不要放到高速RAM区,否则程序跑飞
|
||||
2,由于连续写入多个字节的时间较长,建议不要采用提供函数中的死等的办法,可以在主循环中查PFDL_Handler()
|
||||
3,读出可以直接用CPU指令,不需要库
|
||||
4,输入的地址超出范围,库的返回值有可能不报错,镜像区不报错,保留区跑飞
|
530
app/M12.fcb19.mtud
Normal file
530
app/M12.fcb19.mtud
Normal file
File diff suppressed because one or more lines are too long
113
app/M12.mtpj
113
app/M12.mtpj
@ -64,6 +64,12 @@
|
||||
<TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid>
|
||||
<ParentItem>b2ecf786-e190-4e61-9fd3-7e096982a1e7</ParentItem>
|
||||
</Instance>
|
||||
<Instance Guid="79084d33-0bb5-4e45-bf45-c2f3a133cee9">
|
||||
<Name>datalib</Name>
|
||||
<Type>Category</Type>
|
||||
<ParentItem>b2ecf786-e190-4e61-9fd3-7e096982a1e7</ParentItem>
|
||||
<Property>dfd84c23-91d7-4878-abec-5603b6daf0a4</Property>
|
||||
</Instance>
|
||||
<Instance Guid="3a8bdb55-c122-4735-9349-e31bc68b13b1">
|
||||
<Name>r_main.c</Name>
|
||||
<Type>File</Type>
|
||||
@ -218,6 +224,13 @@
|
||||
<TreeImageGuid>03cad1e8-2eb3-4cde-a8a3-982423631122</TreeImageGuid>
|
||||
<ParentItem>b8348788-df17-4b71-a9fa-eab0f1824fb1</ParentItem>
|
||||
</Instance>
|
||||
<Instance Guid="be606fe4-ee9a-4ef3-8590-553942ed14bf">
|
||||
<Name>r_pfdl.c</Name>
|
||||
<Type>File</Type>
|
||||
<RelativePath>DataFlash\r_pfdl.c</RelativePath>
|
||||
<TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid>
|
||||
<ParentItem>79084d33-0bb5-4e45-bf45-c2f3a133cee9</ParentItem>
|
||||
</Instance>
|
||||
</Class>
|
||||
<Class Guid="fb98844b-2c27-4275-9804-f6e63e204da0">
|
||||
<Instance Guid="fb98844b-2c27-4275-9804-f6e63e204da0">
|
||||
@ -226,6 +239,11 @@
|
||||
<MemoCount>0</MemoCount>
|
||||
</Instance>
|
||||
</Class>
|
||||
<Class Guid="78a5c5cd-76cb-4bcc-a031-3020011fbc9a">
|
||||
<Instance Guid="dfd84c23-91d7-4878-abec-5603b6daf0a4">
|
||||
<MemoCount>0</MemoCount>
|
||||
</Instance>
|
||||
</Class>
|
||||
<Class Guid="8fb9c1f6-d351-4d10-8d99-bf5b3015b84c">
|
||||
<Instance Guid="00000000-0000-0000-0000-000000000000">
|
||||
<UsingPlatformGuid>7e0c5287-ef5f-48f3-976e-25ba00f1983b</UsingPlatformGuid>
|
||||
@ -268,43 +286,45 @@
|
||||
<SourceItemType0>AsmSource</SourceItemType0>
|
||||
<SourceItemGuid1>8031a32c-ef62-4564-a76a-95604fd914b8</SourceItemGuid1>
|
||||
<SourceItemType1>AsmSource</SourceItemType1>
|
||||
<SourceItemGuid2>1c5391f6-dba5-4c90-84f2-04a55a7bc7e2</SourceItemGuid2>
|
||||
<SourceItemGuid2>1cef361f-614b-41de-abe6-75d6d7f284f2</SourceItemGuid2>
|
||||
<SourceItemType2>CSource</SourceItemType2>
|
||||
<SourceItemGuid3>3a8bdb55-c122-4735-9349-e31bc68b13b1</SourceItemGuid3>
|
||||
<SourceItemGuid3>ae745cce-6555-4bc5-b02c-e9b70b278ac3</SourceItemGuid3>
|
||||
<SourceItemType3>CSource</SourceItemType3>
|
||||
<SourceItemGuid4>049d9623-1f0c-4448-aed7-b6f05d823294</SourceItemGuid4>
|
||||
<SourceItemGuid4>eb915dc2-4c62-4ecd-959e-e604b0f7623c</SourceItemGuid4>
|
||||
<SourceItemType4>CSource</SourceItemType4>
|
||||
<SourceItemGuid5>278bbbc6-5343-4321-a327-1e64e960d202</SourceItemGuid5>
|
||||
<SourceItemGuid5>1c5391f6-dba5-4c90-84f2-04a55a7bc7e2</SourceItemGuid5>
|
||||
<SourceItemType5>CSource</SourceItemType5>
|
||||
<SourceItemGuid6>17f20166-02fc-4f9d-b2dd-5678606c671f</SourceItemGuid6>
|
||||
<SourceItemGuid6>3a8bdb55-c122-4735-9349-e31bc68b13b1</SourceItemGuid6>
|
||||
<SourceItemType6>CSource</SourceItemType6>
|
||||
<SourceItemGuid7>834d3576-6535-4ae9-b3c6-e0076a175256</SourceItemGuid7>
|
||||
<SourceItemGuid7>049d9623-1f0c-4448-aed7-b6f05d823294</SourceItemGuid7>
|
||||
<SourceItemType7>CSource</SourceItemType7>
|
||||
<SourceItemGuid8>972ac83e-76a7-415d-b08f-e9f159072a4d</SourceItemGuid8>
|
||||
<SourceItemGuid8>278bbbc6-5343-4321-a327-1e64e960d202</SourceItemGuid8>
|
||||
<SourceItemType8>CSource</SourceItemType8>
|
||||
<SourceItemGuid9>a5a564d3-265c-402e-bbdf-b00f72a73a90</SourceItemGuid9>
|
||||
<SourceItemGuid9>17f20166-02fc-4f9d-b2dd-5678606c671f</SourceItemGuid9>
|
||||
<SourceItemType9>CSource</SourceItemType9>
|
||||
<SourceItemGuid10>46c44ec5-f131-4c65-a43c-c9792f452a06</SourceItemGuid10>
|
||||
<SourceItemGuid10>834d3576-6535-4ae9-b3c6-e0076a175256</SourceItemGuid10>
|
||||
<SourceItemType10>CSource</SourceItemType10>
|
||||
<SourceItemGuid11>41c873f3-1cf2-4c8f-a9bd-b2729e459155</SourceItemGuid11>
|
||||
<SourceItemGuid11>972ac83e-76a7-415d-b08f-e9f159072a4d</SourceItemGuid11>
|
||||
<SourceItemType11>CSource</SourceItemType11>
|
||||
<SourceItemGuid12>d16ded25-28dd-46bb-ae07-8b6312c80600</SourceItemGuid12>
|
||||
<SourceItemGuid12>a5a564d3-265c-402e-bbdf-b00f72a73a90</SourceItemGuid12>
|
||||
<SourceItemType12>CSource</SourceItemType12>
|
||||
<SourceItemGuid13>eb80bee3-e714-4a3e-b8ed-56456ea256a9</SourceItemGuid13>
|
||||
<SourceItemGuid13>46c44ec5-f131-4c65-a43c-c9792f452a06</SourceItemGuid13>
|
||||
<SourceItemType13>CSource</SourceItemType13>
|
||||
<SourceItemGuid14>ecd17489-356b-4667-a2ea-7262a0474482</SourceItemGuid14>
|
||||
<SourceItemGuid14>41c873f3-1cf2-4c8f-a9bd-b2729e459155</SourceItemGuid14>
|
||||
<SourceItemType14>CSource</SourceItemType14>
|
||||
<SourceItemGuid15>f2fe4204-46bd-4f9d-943a-cd21a734e1be</SourceItemGuid15>
|
||||
<SourceItemGuid15>d16ded25-28dd-46bb-ae07-8b6312c80600</SourceItemGuid15>
|
||||
<SourceItemType15>CSource</SourceItemType15>
|
||||
<SourceItemGuid16>cdfbc4af-932a-435e-a8a7-17511b175300</SourceItemGuid16>
|
||||
<SourceItemGuid16>eb80bee3-e714-4a3e-b8ed-56456ea256a9</SourceItemGuid16>
|
||||
<SourceItemType16>CSource</SourceItemType16>
|
||||
<SourceItemGuid17>eb915dc2-4c62-4ecd-959e-e604b0f7623c</SourceItemGuid17>
|
||||
<SourceItemGuid17>ecd17489-356b-4667-a2ea-7262a0474482</SourceItemGuid17>
|
||||
<SourceItemType17>CSource</SourceItemType17>
|
||||
<SourceItemGuid18>ae745cce-6555-4bc5-b02c-e9b70b278ac3</SourceItemGuid18>
|
||||
<SourceItemGuid18>f2fe4204-46bd-4f9d-943a-cd21a734e1be</SourceItemGuid18>
|
||||
<SourceItemType18>CSource</SourceItemType18>
|
||||
<SourceItemGuid19>1cef361f-614b-41de-abe6-75d6d7f284f2</SourceItemGuid19>
|
||||
<SourceItemGuid19>cdfbc4af-932a-435e-a8a7-17511b175300</SourceItemGuid19>
|
||||
<SourceItemType19>CSource</SourceItemType19>
|
||||
<SourceItemCount>20</SourceItemCount>
|
||||
<SourceItemGuid20>be606fe4-ee9a-4ef3-8590-553942ed14bf</SourceItemGuid20>
|
||||
<SourceItemType20>CSource</SourceItemType20>
|
||||
<SourceItemCount>21</SourceItemCount>
|
||||
<LastDeviceChangedCounter>0</LastDeviceChangedCounter>
|
||||
</Instance>
|
||||
<Instance Guid="6bb7060d-7e24-4135-bd9b-7db166417523">
|
||||
@ -470,7 +490,7 @@
|
||||
<COptionCheckLanguageExtension-DefaultValue>False</COptionCheckLanguageExtension-DefaultValue>
|
||||
<COptionMisraIntermodule-DefaultValue>False</COptionMisraIntermodule-DefaultValue>
|
||||
<IsLockedByUser>False</IsLockedByUser>
|
||||
<TimeTagModified--0>-8584991577152226279</TimeTagModified--0>
|
||||
<TimeTagModified--0>-8584966395367472539</TimeTagModified--0>
|
||||
<COptionAsmPath-0>False</COptionAsmPath-0>
|
||||
<COptionChangeMessageError-0>No</COptionChangeMessageError-0>
|
||||
<COptionCharacterSet-0>Auto</COptionCharacterSet-0>
|
||||
@ -479,6 +499,7 @@
|
||||
<COptionG-0>True</COptionG-0>
|
||||
<COptionI-0>.
|
||||
user
|
||||
DataFlash
|
||||
</COptionI-0>
|
||||
<COptionLangC-0>None</COptionLangC-0>
|
||||
<COptionMOrC-0>-c</COptionMOrC-0>
|
||||
@ -691,13 +712,14 @@ user
|
||||
<LinkOptionShowCFI-DefaultValue>False</LinkOptionShowCFI-DefaultValue>
|
||||
<LinkOptionRrmValue-DefaultValue />
|
||||
<IsLockedByUser>False</IsLockedByUser>
|
||||
<TimeTagModified--0>-8584991701281053832</TimeTagModified--0>
|
||||
<TimeTagModified--0>-8584966395561175820</TimeTagModified--0>
|
||||
<LinkOptionAutoSectionLayout-0>True</LinkOptionAutoSectionLayout-0>
|
||||
<LinkOptionCpu-0>False</LinkOptionCpu-0>
|
||||
<LinkOptionDebug-0>Debug</LinkOptionDebug-0>
|
||||
<LinkOptionEntry-0>False</LinkOptionEntry-0>
|
||||
<LinkOptionInput-0 />
|
||||
<LinkOptionLibrary-0 />
|
||||
<LinkOptionLibrary-0>DataFlash\pfdl.lib
|
||||
</LinkOptionLibrary-0>
|
||||
<LinkOptionListShow-0>List</LinkOptionListShow-0>
|
||||
<LinkOptionMessage-0>False</LinkOptionMessage-0>
|
||||
<LinkOptionOcdbg-0>True</LinkOptionOcdbg-0>
|
||||
@ -1067,6 +1089,10 @@ user
|
||||
<ItemAddTime>638380623665584650</ItemAddTime>
|
||||
<ItemAddTimeCount>3</ItemAddTimeCount>
|
||||
</Instance>
|
||||
<Instance Guid="be606fe4-ee9a-4ef3-8590-553942ed14bf">
|
||||
<ItemAddTime>638405928982682324</ItemAddTime>
|
||||
<ItemAddTimeCount>0</ItemAddTimeCount>
|
||||
</Instance>
|
||||
<Instance Guid="0b7e78c3-aadd-45ee-9f9d-ffac6141eeb2">
|
||||
<TimeTagModified-SourceItem0--0>-8585485826286446099</TimeTagModified-SourceItem0--0>
|
||||
<SourceItem0-IsLockedByUser>False</SourceItem0-IsLockedByUser>
|
||||
@ -1082,35 +1108,35 @@ user
|
||||
<SourceItem2-IsLockedByUser>False</SourceItem2-IsLockedByUser>
|
||||
<SourceItem2-BuildingTarget-0>True</SourceItem2-BuildingTarget-0>
|
||||
<SourceItem2-IndividualCompileOption-0>False</SourceItem2-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem3--0>-8585485822306867845</TimeTagModified-SourceItem3--0>
|
||||
<TimeTagModified-SourceItem3--0>-8584991701189191158</TimeTagModified-SourceItem3--0>
|
||||
<SourceItem3-IsLockedByUser>False</SourceItem3-IsLockedByUser>
|
||||
<SourceItem3-BuildingTarget-0>True</SourceItem3-BuildingTarget-0>
|
||||
<SourceItem3-IndividualCompileOption-0>False</SourceItem3-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem4--0>-8585485822306867845</TimeTagModified-SourceItem4--0>
|
||||
<TimeTagModified-SourceItem4--0>-8584991701189191158</TimeTagModified-SourceItem4--0>
|
||||
<SourceItem4-IsLockedByUser>False</SourceItem4-IsLockedByUser>
|
||||
<SourceItem4-BuildingTarget-0>True</SourceItem4-BuildingTarget-0>
|
||||
<SourceItem4-IndividualCompileOption-0>False</SourceItem4-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem5--0>-8585485822306867845</TimeTagModified-SourceItem5--0>
|
||||
<TimeTagModified-SourceItem5--0>-8584991701189191158</TimeTagModified-SourceItem5--0>
|
||||
<SourceItem5-IsLockedByUser>False</SourceItem5-IsLockedByUser>
|
||||
<SourceItem5-BuildingTarget-0>True</SourceItem5-BuildingTarget-0>
|
||||
<SourceItem5-IndividualCompileOption-0>False</SourceItem5-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem6--0>-8585485822306857872</TimeTagModified-SourceItem6--0>
|
||||
<TimeTagModified-SourceItem6--0>-8585485822306867845</TimeTagModified-SourceItem6--0>
|
||||
<SourceItem6-IsLockedByUser>False</SourceItem6-IsLockedByUser>
|
||||
<SourceItem6-BuildingTarget-0>True</SourceItem6-BuildingTarget-0>
|
||||
<SourceItem6-IndividualCompileOption-0>False</SourceItem6-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem7--0>-8585485822306857872</TimeTagModified-SourceItem7--0>
|
||||
<TimeTagModified-SourceItem7--0>-8585485822306867845</TimeTagModified-SourceItem7--0>
|
||||
<SourceItem7-IsLockedByUser>False</SourceItem7-IsLockedByUser>
|
||||
<SourceItem7-BuildingTarget-0>True</SourceItem7-BuildingTarget-0>
|
||||
<SourceItem7-IndividualCompileOption-0>False</SourceItem7-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem8--0>-8585485822306847900</TimeTagModified-SourceItem8--0>
|
||||
<TimeTagModified-SourceItem8--0>-8585485822306867845</TimeTagModified-SourceItem8--0>
|
||||
<SourceItem8-IsLockedByUser>False</SourceItem8-IsLockedByUser>
|
||||
<SourceItem8-BuildingTarget-0>True</SourceItem8-BuildingTarget-0>
|
||||
<SourceItem8-IndividualCompileOption-0>False</SourceItem8-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem9--0>-8585485822306847900</TimeTagModified-SourceItem9--0>
|
||||
<TimeTagModified-SourceItem9--0>-8585485822306857872</TimeTagModified-SourceItem9--0>
|
||||
<SourceItem9-IsLockedByUser>False</SourceItem9-IsLockedByUser>
|
||||
<SourceItem9-BuildingTarget-0>True</SourceItem9-BuildingTarget-0>
|
||||
<SourceItem9-IndividualCompileOption-0>False</SourceItem9-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem10--0>-8585485822306847900</TimeTagModified-SourceItem10--0>
|
||||
<TimeTagModified-SourceItem10--0>-8585485822306857872</TimeTagModified-SourceItem10--0>
|
||||
<SourceItem10-IsLockedByUser>False</SourceItem10-IsLockedByUser>
|
||||
<SourceItem10-BuildingTarget-0>True</SourceItem10-BuildingTarget-0>
|
||||
<SourceItem10-IndividualCompileOption-0>False</SourceItem10-IndividualCompileOption-0>
|
||||
@ -1122,34 +1148,38 @@ user
|
||||
<SourceItem12-IsLockedByUser>False</SourceItem12-IsLockedByUser>
|
||||
<SourceItem12-BuildingTarget-0>True</SourceItem12-BuildingTarget-0>
|
||||
<SourceItem12-IndividualCompileOption-0>False</SourceItem12-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem13--0>-8585485822306837928</TimeTagModified-SourceItem13--0>
|
||||
<TimeTagModified-SourceItem13--0>-8585485822306847900</TimeTagModified-SourceItem13--0>
|
||||
<SourceItem13-IsLockedByUser>False</SourceItem13-IsLockedByUser>
|
||||
<SourceItem13-BuildingTarget-0>True</SourceItem13-BuildingTarget-0>
|
||||
<SourceItem13-IndividualCompileOption-0>False</SourceItem13-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem14--0>-8585485822306837928</TimeTagModified-SourceItem14--0>
|
||||
<TimeTagModified-SourceItem14--0>-8585485822306847900</TimeTagModified-SourceItem14--0>
|
||||
<SourceItem14-IsLockedByUser>False</SourceItem14-IsLockedByUser>
|
||||
<SourceItem14-BuildingTarget-0>True</SourceItem14-BuildingTarget-0>
|
||||
<SourceItem14-IndividualCompileOption-0>False</SourceItem14-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem15--0>-8584991702701908538</TimeTagModified-SourceItem15--0>
|
||||
<TimeTagModified-SourceItem15--0>-8585485822306847900</TimeTagModified-SourceItem15--0>
|
||||
<SourceItem15-IsLockedByUser>False</SourceItem15-IsLockedByUser>
|
||||
<SourceItem15-BuildingTarget-0>True</SourceItem15-BuildingTarget-0>
|
||||
<SourceItem15-IndividualCompileOption-0>False</SourceItem15-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem16--0>-8584991702701898562</TimeTagModified-SourceItem16--0>
|
||||
<TimeTagModified-SourceItem16--0>-8585485822306837928</TimeTagModified-SourceItem16--0>
|
||||
<SourceItem16-IsLockedByUser>False</SourceItem16-IsLockedByUser>
|
||||
<SourceItem16-BuildingTarget-0>True</SourceItem16-BuildingTarget-0>
|
||||
<SourceItem16-IndividualCompileOption-0>False</SourceItem16-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem17--0>-8584991701189191158</TimeTagModified-SourceItem17--0>
|
||||
<TimeTagModified-SourceItem17--0>-8585485822306837928</TimeTagModified-SourceItem17--0>
|
||||
<SourceItem17-IsLockedByUser>False</SourceItem17-IsLockedByUser>
|
||||
<SourceItem17-BuildingTarget-0>True</SourceItem17-BuildingTarget-0>
|
||||
<SourceItem17-IndividualCompileOption-0>False</SourceItem17-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem18--0>-8584991701189191158</TimeTagModified-SourceItem18--0>
|
||||
<TimeTagModified-SourceItem18--0>-8584991702701908538</TimeTagModified-SourceItem18--0>
|
||||
<SourceItem18-IsLockedByUser>False</SourceItem18-IsLockedByUser>
|
||||
<SourceItem18-BuildingTarget-0>True</SourceItem18-BuildingTarget-0>
|
||||
<SourceItem18-IndividualCompileOption-0>False</SourceItem18-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem19--0>-8584991701189191158</TimeTagModified-SourceItem19--0>
|
||||
<TimeTagModified-SourceItem19--0>-8584991702701898562</TimeTagModified-SourceItem19--0>
|
||||
<SourceItem19-IsLockedByUser>False</SourceItem19-IsLockedByUser>
|
||||
<SourceItem19-BuildingTarget-0>True</SourceItem19-BuildingTarget-0>
|
||||
<SourceItem19-IndividualCompileOption-0>False</SourceItem19-IndividualCompileOption-0>
|
||||
<TimeTagModified-SourceItem20--0>-8584966395872093484</TimeTagModified-SourceItem20--0>
|
||||
<SourceItem20-IsLockedByUser>False</SourceItem20-IsLockedByUser>
|
||||
<SourceItem20-BuildingTarget-0>True</SourceItem20-BuildingTarget-0>
|
||||
<SourceItem20-IndividualCompileOption-0>False</SourceItem20-IndividualCompileOption-0>
|
||||
</Instance>
|
||||
</Class>
|
||||
<Class Guid="44fa27c9-0aa0-4297-bd3b-2c5c5bdb8881">
|
||||
@ -2829,9 +2859,9 @@ user
|
||||
</SOAP-ENV:Body>
|
||||
</SOAP-ENV:Envelope>
|
||||
</KeyExtGridLayout>
|
||||
<KeyTopViewZoom>1</KeyTopViewZoom>
|
||||
<KeyTopViewAngle>0</KeyTopViewAngle>
|
||||
<KeyTopViewPartsCollapsed>False</KeyTopViewPartsCollapsed>
|
||||
<KeyTopViewZoom />
|
||||
<KeyTopViewAngle />
|
||||
<KeyTopViewPartsCollapsed />
|
||||
<KEY_SAVE_ALLOCATED_FUNCTION>True</KEY_SAVE_ALLOCATED_FUNCTION>
|
||||
<KEY_SAVE_ALLOCATED_FUNCTION_TERMINAL_NUMBER_COLLECTION>7,8,15,16</KEY_SAVE_ALLOCATED_FUNCTION_TERMINAL_NUMBER_COLLECTION>
|
||||
<KEY_SAVE_ALLOCATED_FCUNTION_COLLECTION7>7,P122,KR2,X2,EXCLK</KEY_SAVE_ALLOCATED_FCUNTION_COLLECTION7>
|
||||
@ -3095,7 +3125,7 @@ user
|
||||
</Effect>
|
||||
</IICA0>
|
||||
<ProjectName Name="PrjName" Text="M12" />
|
||||
<ProjectPath Name="PrjPath" Text="F:\FCB_project\temp\M12\k67" />
|
||||
<ProjectPath Name="PrjPath" Text="E:\workspace\M12\M12-04P\app" />
|
||||
<ProjectKind Name="PrjKind" Text="Project78K0R" />
|
||||
<DeviceName Name="DeviceName" Fixed="" Text="RL78G12" />
|
||||
<MCUName Name="MCUName" Text="RL78G12_20pin" />
|
||||
@ -4272,7 +4302,6 @@ user
|
||||
</RL78G12></CodeGenerator>
|
||||
<FormatVersion>1.0</FormatVersion>
|
||||
<ToolGUID>6c6bb60a-ffe1-4884-8dec-f255a2e58155</ToolGUID>
|
||||
<CodeGeneratorItem>b8348788-df17-4b71-a9fa-eab0f1824fb1</CodeGeneratorItem>
|
||||
</Instance>
|
||||
</Class>
|
||||
<Class Guid="2a2c2a43-ecdb-4e88-80bd-e75f3e33db90">
|
||||
|
@ -38,6 +38,9 @@
|
||||
<Path>user\event.c</Path>
|
||||
<Path>user\hwCtrl.c</Path>
|
||||
<Path>user\MotorCtrl.c</Path>
|
||||
<Category Name="datalib">
|
||||
<Path>DataFlash\r_pfdl.c</Path>
|
||||
</Category>
|
||||
</Files>
|
||||
<DebugOptions>
|
||||
<DebugTool>Simulator</DebugTool>
|
||||
@ -70,10 +73,12 @@
|
||||
<Path>DefaultBuild\event.obj</Path>
|
||||
<Path>DefaultBuild\hwCtrl.obj</Path>
|
||||
<Path>DefaultBuild\MotorCtrl.obj</Path>
|
||||
<Path>DefaultBuild\r_pfdl.obj</Path>
|
||||
</LinkOrder>
|
||||
<CommonOptions>
|
||||
<IncludePathForC>.</IncludePathForC>
|
||||
<IncludePathForC>user</IncludePathForC>
|
||||
<IncludePathForC>DataFlash</IncludePathForC>
|
||||
</CommonOptions>
|
||||
<GeneralOptions>
|
||||
<SimultaneouslyBuild>False</SimultaneouslyBuild>
|
||||
@ -86,6 +91,7 @@
|
||||
<Option>-g_line</Option>
|
||||
<Option>-I .</Option>
|
||||
<Option>-I user</Option>
|
||||
<Option>-I DataFlash</Option>
|
||||
<Option>-far_rom</Option>
|
||||
<Option>-c</Option>
|
||||
</CompileOptions>
|
||||
@ -103,6 +109,7 @@
|
||||
<Option>-NOCOmpress</Option>
|
||||
<Option>-NOOPtimize</Option>
|
||||
<Option>-OUtput=%BuildModeName%\%ProjectName%.abs</Option>
|
||||
<Option>-LIBrary=DataFlash\pfdl.lib</Option>
|
||||
<Option>-LIBrary=%MicomToolPath%\CC-RL\V1.11.00\lib\rl78cm4s.lib</Option>
|
||||
<Option>-LIBrary=%MicomToolPath%\CC-RL\V1.11.00\lib\malloc_n.lib</Option>
|
||||
<Option>-LIBrary=%MicomToolPath%\CC-RL\V1.11.00\lib\rl78cm4r.lib</Option>
|
||||
@ -235,7 +242,7 @@
|
||||
</Effect>
|
||||
</IICA0>
|
||||
<ProjectName Name="PrjName" Text="M12" />
|
||||
<ProjectPath Name="PrjPath" Text="F:\FCB_project\temp\M12\k67" />
|
||||
<ProjectPath Name="PrjPath" Text="E:\workspace\M12\M12-04P\app" />
|
||||
<ProjectKind Name="PrjKind" Text="Project78K0R" />
|
||||
<DeviceName Name="DeviceName" Fixed="" Text="RL78G12" />
|
||||
<MCUName Name="MCUName" Text="RL78G12_20pin" />
|
||||
|
@ -1,17 +1,20 @@
|
||||
QualityReport
|
||||
2024年1月9日 16:52:09
|
||||
2024年1月11日 18:04:47
|
||||
|
||||
------ Start build(M12, DefaultBuild) ------
|
||||
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe user\appTask.c -cpu=S2 -o DefaultBuild\appTask.obj "-dev=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF" -g -g_line -I . -I user -far_rom -c -msg_lang=english
|
||||
user\appTask.c(80):W0520177:Variable "keep_count" was declared but never referenced
|
||||
user\appTask.c(81):W0520177:Variable "i" was declared but never referenced
|
||||
user\appTask.c(149):W0520177:Variable "ledno" was declared but never referenced
|
||||
user\appTask.c(149):W0520177:Variable "last" was declared but never referenced
|
||||
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\rlink.exe -subcommand=DefaultBuild\M12.clnk
|
||||
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe user\MotorCtrl.c -cpu=S2 -o DefaultBuild\MotorCtrl.obj "-dev=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF" -g -g_line -I . -I user -I DataFlash -far_rom -c -msg_lang=english
|
||||
user\MotorCtrl.c(79):W0520167:Argument of type "MEMORY_DATA __near *" is incompatible with parameter of type "uint8_t *__near"
|
||||
user\MotorCtrl.c(90):W0520167:Argument of type "MEMORY_DATA __near *" is incompatible with parameter of type "uint8_t *__near"
|
||||
user\MotorCtrl.c(205):W0520177:Variable "wait2" was declared but never referenced
|
||||
user\MotorCtrl.c(205):W0520177:Variable "wait3" was declared but never referenced
|
||||
user\MotorCtrl.c(352):W0520177:Variable "i" was declared but never referenced
|
||||
user\MotorCtrl.c(421):W0520177:Variable "OC_Count2" was declared but never referenced
|
||||
user\MotorCtrl.c(421):W0520177:Variable "OC_Count3" was declared but never referenced
|
||||
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\Bin\rlink.exe -subcommand=DefaultBuild\M12.clnk
|
||||
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
||||
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
||||
Renesas Optimizing Linker Completed
|
||||
------ Build ended(Error:0, Warning:6)(M12, DefaultBuild) ------
|
||||
------ Build ended(Error:0, Warning:9)(M12, DefaultBuild) ------
|
||||
|
||||
--- CommandFile 1 ---
|
||||
DefaultBuild\M12.clnk :
|
||||
@ -35,15 +38,17 @@ DefaultBuild\M12.clnk :
|
||||
-Input=DefaultBuild\event.obj
|
||||
-Input=DefaultBuild\hwCtrl.obj
|
||||
-Input=DefaultBuild\MotorCtrl.obj
|
||||
-Input=DefaultBuild\r_pfdl.obj
|
||||
-SECURITY_ID=00000000000000000000
|
||||
-DEVICE=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF
|
||||
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF
|
||||
-DEBug
|
||||
-NOCOmpress
|
||||
-NOOPtimize
|
||||
-OUtput=DefaultBuild\M12.abs
|
||||
-LIBrary=E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\lib\rl78cm4s.lib
|
||||
-LIBrary=E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\lib\malloc_n.lib
|
||||
-LIBrary=E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\lib\rl78cm4r.lib
|
||||
-LIBrary=E:\workspace\M12\M12-04P\app\DataFlash\pfdl.lib
|
||||
-LIBrary=C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\lib\rl78cm4s.lib
|
||||
-LIBrary=C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\lib\malloc_n.lib
|
||||
-LIBrary=C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\lib\rl78cm4r.lib
|
||||
-OCDBG=04
|
||||
-USER_OPT_BYTE=7A47E0
|
||||
-LISt=DefaultBuild\M12.map
|
||||
@ -55,7 +60,7 @@ DefaultBuild\M12.clnk :
|
||||
-NOLOgo
|
||||
-end
|
||||
-Input=DefaultBuild\M12.abs
|
||||
-DEVICE=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF
|
||||
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF
|
||||
-OUtput=DefaultBuild\M12.mot
|
||||
-FOrm=Stype
|
||||
-NOMessage
|
||||
@ -63,13 +68,13 @@ DefaultBuild\M12.clnk :
|
||||
|
||||
|
||||
--- SHA1 hash value of output files ---
|
||||
F:\FCB_project\temp\M12\k67\DefaultBuild\M12.abs: bb5ed562599dd7d737b526f6bfe8f5bf91273db8
|
||||
F:\FCB_project\temp\M12\k67\DefaultBuild\M12.mot: a9662f7f1b8e4c50f3dde3a91e5ed12b45438b9d
|
||||
E:\workspace\M12\M12-04P\app\DefaultBuild\M12.abs: 0f9f247599561b925fe3b46e37b25b006faec007
|
||||
E:\workspace\M12\M12-04P\app\DefaultBuild\M12.mot: dbfa2ed893ee29b958e377fd41de31ce567e9f04
|
||||
|
||||
|
||||
--- System Information ---
|
||||
*OS Version
|
||||
Microsoft Windows 10 专业版 (-, 10.0.19045, WOW64)
|
||||
Microsoft Windows 11 专业版 (-, 10.0.22621, WOW64)
|
||||
*Language
|
||||
中文(中国)
|
||||
*.NET Framework Version
|
||||
@ -89,16 +94,16 @@ F:\FCB_project\temp\M12\k67\DefaultBuild\M12.mot: a9662f7f1b8e4c50f3dde3a91e5ed1
|
||||
*Product License
|
||||
|
||||
*Execution Place
|
||||
E:\Program Files (x86)\renesas\CS+\CC
|
||||
C:\Program Files (x86)\Renesas Electronics\CS+\CC
|
||||
*Memory Usage
|
||||
*Private Working Set
|
||||
269 MB
|
||||
259 MB
|
||||
*Number of GDI Objects
|
||||
1973
|
||||
2026
|
||||
*Number of USER Objects
|
||||
1092
|
||||
1178
|
||||
*Opened Files
|
||||
3 editors, 3 files, 21 KB
|
||||
1 editors, 1 files, 12 KB
|
||||
|
||||
--- Build Tool Plug-in Information ---
|
||||
RH850 Build tool CC-RH Plug-in
|
||||
@ -227,11 +232,11 @@ Device Information Common Interface
|
||||
DeviceInformation.dll
|
||||
|
||||
--- Main Project Information ---
|
||||
F:\FCB_project\temp\M12\k67\M12.mtpj
|
||||
E:\workspace\M12\M12-04P\app\M12.mtpj
|
||||
Microcontroller Information
|
||||
*R5F10268
|
||||
*File Name: Version
|
||||
RL78_Productlist.xml: V8.070000
|
||||
RL78_Productlist.xml: V8.070100
|
||||
R5F10268_common.xml: V1.10.00.XX.01
|
||||
DR5F10268.DVF: V1.12
|
||||
g12_26xasp_flash.ti: V1.00
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "hwCtrl.h"
|
||||
#include "PINdef.h"
|
||||
#include "appTask.h"
|
||||
//#include "pfdl.h"
|
||||
#include "pfdl.h"
|
||||
|
||||
|
||||
uint8_t MotorState[6],MotorStateReal[6];
|
||||
@ -76,7 +76,7 @@ void WriteMotorMemory(void)
|
||||
|
||||
|
||||
MemoryData.checksum = GetCheckSum(&MemoryData.MotorData[0].MotorStopLoc1,36);
|
||||
//if(WriteDataflash(&MemoryData,0x000F1000,sizeof(MemoryData)) == 0x11)
|
||||
if(WriteDataflash(&MemoryData,0x000F1000,sizeof(MemoryData)) == 0x11)
|
||||
{
|
||||
EEL_SAVE_REQUIRE_FLAG=0;
|
||||
}
|
||||
@ -87,7 +87,7 @@ void ReadMotorMemory(void)
|
||||
{
|
||||
uint16_t checksum;
|
||||
uint8_t i;
|
||||
//ReadFlashData(&MemoryData,0x000F1000,sizeof(MemoryData));
|
||||
ReadFlashData(&MemoryData,0x000F1000,sizeof(MemoryData));
|
||||
checksum = GetCheckSum(&MemoryData.MotorData[0].MotorStopLoc1,36);
|
||||
if (MemoryData.start_flag == START_FLAG && MemoryData.stop_flag == STOP_FLAG && checksum == MemoryData.checksum)//
|
||||
{
|
||||
@ -130,33 +130,43 @@ void MotorValueInit(void)
|
||||
MotorHardStop2[i] = 0;
|
||||
|
||||
}
|
||||
//ReadMotorMemory();
|
||||
ReadMotorMemory();
|
||||
}
|
||||
|
||||
|
||||
uint16_t MotorTarget[6] = {0};
|
||||
void setMotorTarget(uint8_t motorid,uint16_t target)
|
||||
{
|
||||
if (MotorTarget[motorid] != 0)
|
||||
{
|
||||
MotorTarget[motorid] = 0;
|
||||
setMotorState(motorid,ACT_NOACT);
|
||||
}
|
||||
else
|
||||
{
|
||||
MotorTarget[motorid] = target;
|
||||
}
|
||||
|
||||
}
|
||||
void setMotorAutoXQ(void)
|
||||
{
|
||||
setMotorTarget(MOTOR1,MotorHardStop1[0] - 2500);
|
||||
//MotorTarget[0] = MotorHardStop1[0] - 2500;
|
||||
}
|
||||
void setMotorAutoXH(void)
|
||||
{
|
||||
//MotorTarget[0] = MotorHardStop1[0] - 10;
|
||||
setMotorTarget(MOTOR1,MotorHardStop1[0] - 10);
|
||||
}
|
||||
void setMotorState(uint8_t motorid,uint8_t act)
|
||||
{
|
||||
//motorid-=1;
|
||||
if (act <= ACT_XH && motorid < 6)
|
||||
{
|
||||
MotorState[motorid] = act;
|
||||
setMotorTarget(0,0);
|
||||
}
|
||||
}
|
||||
uint16_t MotorTarget[6] = {0};
|
||||
|
||||
void setMotorAutoXQ(void)
|
||||
{
|
||||
|
||||
MotorTarget[0] = MotorHardStop1[0] - 2500;
|
||||
}
|
||||
void setMotorAutoXH(void)
|
||||
{
|
||||
MotorTarget[0] = MotorHardStop1[0] - 10;
|
||||
}
|
||||
void setMotorTarget(uint8_t motorid,uint16_t target)
|
||||
{
|
||||
|
||||
MotorTarget[motorid] = target;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -340,7 +350,7 @@ void AutoCalCtrl(void)
|
||||
void MotorCtrl(void)//10ms
|
||||
{
|
||||
uint8_t i;
|
||||
//WriteMotorMemory(); //TODO
|
||||
WriteMotorMemory(); //TODO
|
||||
//AutoCalCtrl();
|
||||
|
||||
if (OC1flag == 1)
|
||||
|
@ -71,7 +71,7 @@ void keyLogicRelease(uint8_t keyno)
|
||||
}
|
||||
|
||||
}
|
||||
#define KEY_DELAY_TIME_30ms 10
|
||||
#define KEY_DELAY_TIME_30ms 6
|
||||
#define KEY_DELAY_TIME_200ms 60
|
||||
void keyScan(void)//5ms
|
||||
{
|
||||
@ -81,13 +81,9 @@ void keyScan(void)//5ms
|
||||
uint8_t keyval,i;
|
||||
//向后
|
||||
keyval = GetIOState(SIGID_KEY1);
|
||||
if (keyval == 1 )//&& keyflag[KEY1] == 0
|
||||
if (keyval == 1 && keyflag[KEY1] == 0)//&& keyflag[KEY1] == 0
|
||||
{
|
||||
keydelay[KEY1]++;
|
||||
if (keydelay[KEY1] > KEY_DELAY_TIME_30ms)//30ms
|
||||
{
|
||||
keyflag[KEY1] = 1;
|
||||
}
|
||||
if (keydelay[KEY1] > KEY_DELAY_TIME_200ms)//200ms
|
||||
{
|
||||
keyflag[KEY1] = 1;
|
||||
@ -97,7 +93,7 @@ void keyScan(void)//5ms
|
||||
}
|
||||
else if (keyval == 0)
|
||||
{
|
||||
if (keyflag[KEY1] == 1 && keydelay[KEY1] < KEY_DELAY_TIME_200ms)
|
||||
if (keydelay[KEY1]>KEY_DELAY_TIME_30ms && keydelay[KEY1] < KEY_DELAY_TIME_200ms)
|
||||
{
|
||||
//自动
|
||||
setMotorAutoXH();
|
||||
@ -112,13 +108,9 @@ void keyScan(void)//5ms
|
||||
}
|
||||
//向前
|
||||
keyval = GetIOState(SIGID_KEY2);
|
||||
if (keyval == 1 )//&& keyflag[KEY2] == 0
|
||||
if (keyval == 1 && keyflag[KEY2] == 0)//&& keyflag[KEY2] == 0
|
||||
{
|
||||
keydelay[KEY2]++;
|
||||
if (keydelay[KEY2] > KEY_DELAY_TIME_30ms)//30ms
|
||||
{
|
||||
keyflag[KEY2] = 1;
|
||||
}
|
||||
if (keydelay[KEY2] > KEY_DELAY_TIME_200ms)//200ms
|
||||
{
|
||||
keyflag[KEY2] = 1;
|
||||
@ -129,7 +121,7 @@ void keyScan(void)//5ms
|
||||
}
|
||||
else if (keyval == 0)
|
||||
{
|
||||
if (keyflag[KEY2] == 1 && keydelay[KEY2] < KEY_DELAY_TIME_200ms)
|
||||
if (keydelay[KEY2] > KEY_DELAY_TIME_30ms && keydelay[KEY2] < KEY_DELAY_TIME_200ms)
|
||||
{
|
||||
//自动
|
||||
setMotorAutoXQ();
|
||||
|
Loading…
x
Reference in New Issue
Block a user