mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 16:33:34 +08:00
Add W25 FLASH driver; Use attribute definitions in nuttx/compiler.h
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5161 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
@@ -78,7 +79,7 @@ struct adc_msg_s
|
||||
{
|
||||
uint8_t am_channel; /* The 8-bit ADC Channel */
|
||||
int32_t am_data; /* ADC convert result (4 bytes) */
|
||||
} __attribute__((__packed__));
|
||||
} packed_struct;
|
||||
|
||||
struct adc_fifo_s
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/compiler.h
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -92,6 +92,14 @@
|
||||
# define reentrant_function
|
||||
# define naked_function
|
||||
|
||||
/* The inline_function attribute informs GCC that the function should always
|
||||
* be inlined, regardless of the level of optimization. The noinline_function
|
||||
* indicates that the function should never be inlined.
|
||||
*/
|
||||
|
||||
# define inline_function __attribute__ ((always_inline))
|
||||
# define noinline_function __attribute__ ((noinline))
|
||||
|
||||
/* GCC has does not use storage classes to qualify addressing */
|
||||
|
||||
# define FAR
|
||||
@@ -224,10 +232,15 @@
|
||||
# define noreturn_function
|
||||
# define packed_struct
|
||||
|
||||
/* SDCC does support "naked" function s*/
|
||||
/* SDCC does support "naked" functions */
|
||||
|
||||
# define naked_function __naked
|
||||
|
||||
/* SDCC does not support forced inlining. */
|
||||
|
||||
# define inline_function
|
||||
# define noinline_function
|
||||
|
||||
/* The reentrant attribute informs SDCC that the function
|
||||
* must be reentrant. In this case, SDCC will store input
|
||||
* arguments on the stack to support reentrancy.
|
||||
@@ -320,11 +333,13 @@
|
||||
# define weak_function
|
||||
# define weak_const_function
|
||||
|
||||
/* The Zilog compiler does not support the noreturn, packed, or naked attributes */
|
||||
/* The Zilog compiler does not support the noreturn, packed, naked attributes */
|
||||
|
||||
# define noreturn_function
|
||||
# define packed_struct
|
||||
# define naked_function
|
||||
# define inline_function
|
||||
# define noinline_function
|
||||
|
||||
/* The Zilog compiler does not support the reentrant attribute */
|
||||
|
||||
@@ -406,7 +421,8 @@
|
||||
# define packed_struct
|
||||
# define reentrant_function
|
||||
# define naked_function
|
||||
|
||||
# define inline_function
|
||||
# define noinline_function
|
||||
|
||||
# define FAR
|
||||
# define NEAR
|
||||
|
||||
@@ -220,6 +220,19 @@ EXTERN FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_dev_s *dev);
|
||||
|
||||
EXTERN FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Name: w25_initialize
|
||||
*
|
||||
* Description:
|
||||
* Create an initialized MTD device instance. MTD devices are not registered
|
||||
* in the file system, but are created as instances that can be bound to
|
||||
* other functions (such as a block or character driver front end).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
EXTERN FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *dev);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user