Assembly Atmel Studio:行尾垃圾错误
我正在尝试使用来自的ATMEL CAN库编译一个在AT90CAN128上运行的程序 但是,当我尝试编译时,在Atmel Studio 6中会出现以下错误 # | Description | File | Row | Col 1 | missing ')' | -\Temp\ccMKhrlO.s | 89 | 1 2 | garbage at end of line | -\Temp\ccMKhrlO.s | 89 | 1 看起来它没有正确地将flash_appli_lib.c转换为程序集。但是,查看该文件并没有显示明显的问题 flash_appli_lib.cAssembly Atmel Studio:行尾垃圾错误,assembly,avr,avr-gcc,Assembly,Avr,Avr Gcc,我正在尝试使用来自的ATMEL CAN库编译一个在AT90CAN128上运行的程序 但是,当我尝试编译时,在Atmel Studio 6中会出现以下错误 # | Description | File | Row | Col 1 | missing ')' | -\Temp\ccMKhrlO.s | 89 | 1 2 | garbage at end of line | -\Temp
//******************************************************************************
//! @file $RCSfile: flash_appli_lib.c,v $
//!
//! Copyright (c) 2007 Atmel.
//!
//! Use of this program is subject to Atmel's End User License Agreement.
//! Please read file license.txt for copyright notice.
//!
//! @brief This file contains the library of functions of:
//! - Flash (code in "Application Flash Section")
//! - for AT90CAN128/64/32.
//!
//! This file can be parsed by Doxygen for automatic documentation generation.
//! This file has been validated with AVRStudio-413528/WinAVR-20070122.
//!
//! @version $Revision: 3.20 $ $Name: jtellier $
//!
//! @todo
//! @bug
//******************************************************************************
//_____ I N C L U D E S ________________________________________________________
#include "config.h"
#include "flash_appli_lib.h"
#include "flash_appli_drv.h"
//_____ D E F I N I T I O N S __________________________________________________
//_____ F U N C T I O N S ______________________________________________________
//------------------------------------------------------------------------------
// @fn flash_rd_byte
//!
//! This function allows to read a byte in 64K bytes of Flash memory.
//!
//! @warning: _RAMPZ_IS_USED must be defined in "config.h"
//! @warning: The 64K page setting must be done before (ex: setting
//! or clearing the RAMPZ register).
//!
//! @param: addr_byte Address to read the byte in Flash memory.
//!
//! @return: Value read in the Flash memory.
//!
//------------------------------------------------------------------------------
U8 flash_rd_byte(U16 addr_byte)
{
#if defined(_RAMPZ_IS_USED_)
U32 far_addr_byte;
far_addr_byte = (((U32)(RAMPZ))<<16) | ((U32)(addr_byte));
return (Farflash_rd_byte(far_addr_byte));
#else
return (Stdflash_rd_byte(addr_byte));
#endif //- If _RAMPZ_IS_USED_ ...
// return (Flash_rd_byte(addr_word));
}
//------------------------------------------------------------------------------
// @fn flash_rd_word
//!
//! This function allows to read a word in 64K bytes of Flash memory.
//!
//! @warning: _RAMPZ_IS_USED must be defined in "config.h"
//! @warning: 1 - The address of the word is an even byte address.
//! 2 - The 64K page setting must be done before (ex: setting
//! or clearing the RAMPZ register).
//!
//! @param: addr_word Address to read the word in Flash memory.
//!
//! @return: Value read in the Flash memory.
//!
//------------------------------------------------------------------------------
U16 flash_rd_word(U16 addr_word)
{
#if defined(_RAMPZ_IS_USED_)
U32 far_addr_word;
far_addr_word = (((U32)(RAMPZ))<<16) | ((U32)(addr_word));
return (Farflash_rd_word(far_addr_word));
#else
return (Stdflash_rd_word(addr_word));
#endif //- If _RAMPZ_IS_USED_ ...
// return (Flash_rd_word(addr_word));
}
//------------------------------------------------------------------------------
// @fn flash_appli_wr_byte
//!
//! This function allows to write a byte in 64K bytes of Flash memory.
//!
//! @warning: The 64K page setting must be done before (ex: setting
//! or clearing the RAMPZ register).
//!
//! @param: addr_byte Address to write the byte in Flash memory.
//! value Value to write in the Flash memory.
//!
//! @return none
//!
//------------------------------------------------------------------------------
void flash_appli_wr_byte(U16 addr_byte, U8 value)
{
flash_appli_wr_block(&value, addr_byte, 1);
}
//------------------------------------------------------------------------------
// @fn flash_appli_wr_block
//!
//! This application function calls flash_wr_block() function of the BootLoader
//! if the application is runnning supervised by the BootLoader developped
//! by ATMEL (see "can_bootloader_example" or "can_uart_bootloader_example").
//!
//! @warning: The 64K page setting must be done before (ex: setting
//! or clearing the RAMPZ register).
//! @warning: See flash_wr_block() function in "flash_boot_lib.c".
//!
//! @param: - src Source of (SRAM) buffer Address.
//! - dest Destination, start address in Flash memory where data
//! must be written.
//! - byte_nb Number of byte to write.
//!
//! @return none
//!
//------------------------------------------------------------------------------
void flash_appli_wr_block(U8* src, U16 dest, U16 byte_nb)
{
Call_flash_appli_wr_block();
}
//******************************************************************************
//! @文件$RCSfile:flash\u appli\u lib.c,v$
//!
//! 版权所有(c)2007阿特梅尔。
//!
//! 本程序的使用须遵守Atmel的最终用户许可协议。
//! 请阅读license.txt文件了解版权声明。
//!
//! @简介此文件包含以下函数库:
//! - 闪存(“应用闪存部分”中的代码)
//! - 对于AT90CAN128/64/32。
//!
//! Doxygen可以解析此文件,以自动生成文档。
//! 该文件已通过AVRStudio-413528/WinAVR-20070122验证。
//!
//! @版本$Revision:3.20$$Name:jtellier$
//!
//! @待办事项
//! @缺陷
//******************************************************************************
//_____I N C L D S________________________________________________________
#包括“config.h”
#包括“flash\u appli\u lib.h”
#包括“flash\u appli\u drv.h”
//_____D E F I T N S__________________________________________________
//_____F U N C T I O N S______________________________________________________
//------------------------------------------------------------------------------
//@fn flash\u rd\u字节
//!
//! 此功能允许读取64K字节闪存中的一个字节。
//!
//! @警告:必须在“config.h”中定义所使用的
//! @警告:必须先完成64K页面设置(例如:设置
//!或清除RAMPZ寄存器)。
//!
//! @param:addr_字节地址,用于读取闪存中的字节。
//!
//! @返回:闪存中读取的值。
//!
//------------------------------------------------------------------------------
U8闪存字节(U16地址字节)
{
#如果已定义(_RAMPZ_已使用)
U32远地址字节;
far_addr_byte=((U32)(RAMPZ))我通过从项目中删除有问题的c文件修复了错误。
似乎Atmel studio正在尝试编译所有内容,而不仅仅是从main链接的内容
//******************************************************************************
//! @file $RCSfile: flash_appli_lib.c,v $
//!
//! Copyright (c) 2007 Atmel.
//!
//! Use of this program is subject to Atmel's End User License Agreement.
//! Please read file license.txt for copyright notice.
//!
//! @brief This file contains the library of functions of:
//! - Flash (code in "Application Flash Section")
//! - for AT90CAN128/64/32.
//!
//! This file can be parsed by Doxygen for automatic documentation generation.
//! This file has been validated with AVRStudio-413528/WinAVR-20070122.
//!
//! @version $Revision: 3.20 $ $Name: jtellier $
//!
//! @todo
//! @bug
//******************************************************************************
//_____ I N C L U D E S ________________________________________________________
#include "config.h"
#include "flash_appli_lib.h"
#include "flash_appli_drv.h"
//_____ D E F I N I T I O N S __________________________________________________
//_____ F U N C T I O N S ______________________________________________________
//------------------------------------------------------------------------------
// @fn flash_rd_byte
//!
//! This function allows to read a byte in 64K bytes of Flash memory.
//!
//! @warning: _RAMPZ_IS_USED must be defined in "config.h"
//! @warning: The 64K page setting must be done before (ex: setting
//! or clearing the RAMPZ register).
//!
//! @param: addr_byte Address to read the byte in Flash memory.
//!
//! @return: Value read in the Flash memory.
//!
//------------------------------------------------------------------------------
U8 flash_rd_byte(U16 addr_byte)
{
#if defined(_RAMPZ_IS_USED_)
U32 far_addr_byte;
far_addr_byte = (((U32)(RAMPZ))<<16) | ((U32)(addr_byte));
return (Farflash_rd_byte(far_addr_byte));
#else
return (Stdflash_rd_byte(addr_byte));
#endif //- If _RAMPZ_IS_USED_ ...
// return (Flash_rd_byte(addr_word));
}
//------------------------------------------------------------------------------
// @fn flash_rd_word
//!
//! This function allows to read a word in 64K bytes of Flash memory.
//!
//! @warning: _RAMPZ_IS_USED must be defined in "config.h"
//! @warning: 1 - The address of the word is an even byte address.
//! 2 - The 64K page setting must be done before (ex: setting
//! or clearing the RAMPZ register).
//!
//! @param: addr_word Address to read the word in Flash memory.
//!
//! @return: Value read in the Flash memory.
//!
//------------------------------------------------------------------------------
U16 flash_rd_word(U16 addr_word)
{
#if defined(_RAMPZ_IS_USED_)
U32 far_addr_word;
far_addr_word = (((U32)(RAMPZ))<<16) | ((U32)(addr_word));
return (Farflash_rd_word(far_addr_word));
#else
return (Stdflash_rd_word(addr_word));
#endif //- If _RAMPZ_IS_USED_ ...
// return (Flash_rd_word(addr_word));
}
//------------------------------------------------------------------------------
// @fn flash_appli_wr_byte
//!
//! This function allows to write a byte in 64K bytes of Flash memory.
//!
//! @warning: The 64K page setting must be done before (ex: setting
//! or clearing the RAMPZ register).
//!
//! @param: addr_byte Address to write the byte in Flash memory.
//! value Value to write in the Flash memory.
//!
//! @return none
//!
//------------------------------------------------------------------------------
void flash_appli_wr_byte(U16 addr_byte, U8 value)
{
flash_appli_wr_block(&value, addr_byte, 1);
}
//------------------------------------------------------------------------------
// @fn flash_appli_wr_block
//!
//! This application function calls flash_wr_block() function of the BootLoader
//! if the application is runnning supervised by the BootLoader developped
//! by ATMEL (see "can_bootloader_example" or "can_uart_bootloader_example").
//!
//! @warning: The 64K page setting must be done before (ex: setting
//! or clearing the RAMPZ register).
//! @warning: See flash_wr_block() function in "flash_boot_lib.c".
//!
//! @param: - src Source of (SRAM) buffer Address.
//! - dest Destination, start address in Flash memory where data
//! must be written.
//! - byte_nb Number of byte to write.
//!
//! @return none
//!
//------------------------------------------------------------------------------
void flash_appli_wr_block(U8* src, U16 dest, U16 byte_nb)
{
Call_flash_appli_wr_block();
}