mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
packed_struct replaced by begin_packed_struct and end_packed_struct
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* include/nuttx/analog/adc.h
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011 Li Zhuoyi. All rights reserved.
|
||||
* Author: Li Zhuoyi <lzyy.cn@gmail.com>
|
||||
* Gregory Nutt <gnutt@nuttx.org>
|
||||
@@ -103,11 +103,11 @@ struct adc_callback_s
|
||||
|
||||
/* This describes on ADC message */
|
||||
|
||||
struct adc_msg_s
|
||||
begin_packed_struct struct adc_msg_s
|
||||
{
|
||||
uint8_t am_channel; /* The 8-bit ADC Channel */
|
||||
int32_t am_data; /* ADC convert result (4 bytes) */
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
|
||||
/* This describes a FIFO of ADC messages */
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/************************************************************************************
|
||||
* include/nuttx/analog/dac.h
|
||||
*
|
||||
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011 Li Zhuoyi. All rights reserved.
|
||||
* Author: Li Zhuoyi <lzyy.cn@gmail.com>
|
||||
* History: 0.1 2011-08-04 initial version
|
||||
@@ -74,11 +75,11 @@
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
|
||||
struct dac_msg_s
|
||||
begin_packed_struct struct dac_msg_s
|
||||
{
|
||||
uint8_t am_channel; /* The 8-bit DAC Channel */
|
||||
int32_t am_data; /* DAC convert result (4 bytes) */
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
|
||||
struct dac_fifo_s
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/audio/audio.h
|
||||
*
|
||||
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013 Ken Pettit. All rights reserved.
|
||||
* Author: Ken Pettit <pettitkd@gmail.com>
|
||||
*
|
||||
@@ -363,7 +364,7 @@ struct ap_buffer_info_s
|
||||
|
||||
/* This structure describes an Audio Pipeline Buffer */
|
||||
|
||||
struct ap_buffer_s
|
||||
begin_packed_struct struct ap_buffer_s
|
||||
{
|
||||
struct dq_entry_s dq_entry; /* Double linked queue entry */
|
||||
struct audio_info_s i; /* The info for samples in this buffer */
|
||||
@@ -377,7 +378,7 @@ struct ap_buffer_s
|
||||
uint16_t flags; /* Buffer flags */
|
||||
uint16_t crefs; /* Number of reference counts */
|
||||
uint8_t samp[0]; /* Offset of the first sample */
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
|
||||
/* Structure defining the messages passed to a listening audio thread
|
||||
* for dequeuing buffers and other operations. Also used to allocate
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/compiler.h
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2012-2013, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2012-2013, 2015-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -81,7 +81,7 @@
|
||||
# define weak_alias(name, aliasname)
|
||||
# define weak_function
|
||||
# define weak_const_function
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* The noreturn attribute informs GCC that the function will not return. */
|
||||
|
||||
@@ -97,7 +97,8 @@
|
||||
* ignoring other alignment rules.
|
||||
*/
|
||||
|
||||
# define packed_struct __attribute__ ((packed))
|
||||
# define begin_packed_struct
|
||||
# define end_packed_struct __attribute__ ((packed))
|
||||
|
||||
/* GCC does not support the reentrant attribute */
|
||||
|
||||
@@ -279,7 +280,8 @@
|
||||
/* SDCC does not support the noreturn or packed attributes */
|
||||
|
||||
# define noreturn_function
|
||||
# define packed_struct
|
||||
# define begin_packed_struct
|
||||
# define end_packed_struct
|
||||
|
||||
/* REVISIT: */
|
||||
|
||||
@@ -397,7 +399,8 @@
|
||||
/* The Zilog compiler does not support the noreturn, packed, naked attributes */
|
||||
|
||||
# define noreturn_function
|
||||
# define packed_struct
|
||||
# define begin_packed_struct
|
||||
# define end_packed_struct
|
||||
# define naked_function
|
||||
# define inline_function
|
||||
# define noinline_function
|
||||
@@ -489,7 +492,8 @@
|
||||
# define weak_const_function
|
||||
# define noreturn_function
|
||||
# define farcall_function
|
||||
# define packed_struct
|
||||
# define begin_packed_struct __packed
|
||||
# define end_packed_struct
|
||||
# define reentrant_function
|
||||
# define naked_function
|
||||
# define inline_function
|
||||
@@ -526,7 +530,8 @@
|
||||
# define restrict
|
||||
# define noreturn_function
|
||||
# define farcall_function
|
||||
# define packed_struct
|
||||
# define begin_packed_struct
|
||||
# define end_packed_struct
|
||||
# define reentrant_function
|
||||
# define naked_function
|
||||
# define inline_function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* include/nuttx/drivers/can.h
|
||||
*
|
||||
* Copyright (C) 2008, 2009, 2011-2012, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008, 2009, 2011-2012, 2015-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -388,7 +388,7 @@
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_CAN_EXTID
|
||||
struct can_hdr_s
|
||||
begin_packed_struct struct can_hdr_s
|
||||
{
|
||||
uint32_t ch_id; /* 11- or 29-bit ID (20- or 3-bits unused) */
|
||||
uint8_t ch_dlc : 4; /* 4-bit DLC */
|
||||
@@ -398,9 +398,9 @@ struct can_hdr_s
|
||||
#endif
|
||||
uint8_t ch_extid : 1; /* Extended ID indication */
|
||||
uint8_t ch_unused : 1; /* Unused */
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
#else
|
||||
struct can_hdr_s
|
||||
begin_packed_struct struct can_hdr_s
|
||||
{
|
||||
uint16_t ch_id; /* 11-bit standard ID (5-bits unused) */
|
||||
uint8_t ch_dlc : 4; /* 4-bit DLC. May be encoded in CAN_FD mode. */
|
||||
@@ -409,14 +409,14 @@ struct can_hdr_s
|
||||
uint8_t ch_error : 1; /* 1=ch_id is an error report */
|
||||
#endif
|
||||
uint8_t ch_unused : 2; /* Unused */
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
#endif
|
||||
|
||||
struct can_msg_s
|
||||
begin_packed_struct struct can_msg_s
|
||||
{
|
||||
struct can_hdr_s cm_hdr; /* The CAN header */
|
||||
uint8_t cm_data[CAN_MAXDATALEN]; /* CAN message data (0-8 byte) */
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
|
||||
/* This structure defines a CAN message FIFO. */
|
||||
|
||||
|
||||
+13
-13
@@ -2,7 +2,7 @@
|
||||
* include/nuttx/usb/audio.h
|
||||
* Audio Device Class (ADC) definitions
|
||||
*
|
||||
* Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012-2013, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References: This header file is based on information provided by the
|
||||
@@ -1321,18 +1321,18 @@ struct adc_l1_curparm_s
|
||||
|
||||
/* Layout 1, Control RANGE Parameter Block */
|
||||
|
||||
struct adc_l1_subrange_s
|
||||
begin_packed_struct struct adc_l1_subrange_s
|
||||
{
|
||||
uint8_t l1_min; /* 0: MIN attribute */
|
||||
uint8_t l1_max; /* 1: MAX attribute */
|
||||
uint8_t l1_res; /* 2: RES attribute */
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
|
||||
struct adc_l1_rangeparm_s
|
||||
begin_packed_struct struct adc_l1_rangeparm_s
|
||||
{
|
||||
uint8_t l1_nranges; /* 0: Number of sub-ranges */
|
||||
struct adc_l1_subrange_s l1_subrange[1];
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
|
||||
#define USB_SIZEOF_ADC_LI_RANGEPARM(nranges) (1+3*(nranges))
|
||||
|
||||
@@ -1422,18 +1422,18 @@ struct adc_equalizer_curparm_s
|
||||
|
||||
/* Graphic Equalizer Control RANGE Parameter Block */
|
||||
|
||||
struct adc_eq_subrange_s
|
||||
begin_packed_struct struct adc_eq_subrange_s
|
||||
{
|
||||
uint8_t eq_min; /* 0: MIN attribute */
|
||||
uint8_t eq_max; /* 1: MAX attribute */
|
||||
uint8_t eq_res; /* 2: RES attribute */
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
|
||||
struct adc_equalizer_rangeparm_s
|
||||
begin_packed_struct struct adc_equalizer_rangeparm_s
|
||||
{
|
||||
uint8_t eq_nranges; /* 0: Number of sub-ranges */
|
||||
struct adc_eq_subrange_s eq_subrange[1];
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
|
||||
#define USB_SIZEOF_ADC_EQUALIZER_RANGEPARM(nranges) (1+3*(nranges))
|
||||
|
||||
@@ -1457,18 +1457,18 @@ struct adc_hilo_curparm_s
|
||||
|
||||
/* High/Low Scaling Control RANGE Parameter Block */
|
||||
|
||||
struct adc_hl_subrange_s
|
||||
begin_packed_struct struct adc_hl_subrange_s
|
||||
{
|
||||
uint8_t hl_min; /* 0: MIN attribute */
|
||||
uint8_t hl_max; /* 1: MAX attribute */
|
||||
uint8_t hl_res; /* 2: RES attribute */
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
|
||||
struct adc_hilo_rangeparm_s
|
||||
begin_packed_struct struct adc_hilo_rangeparm_s
|
||||
{
|
||||
uint8_t hl_nranges[2]; /* 0: Number of sub-ranges */
|
||||
struct adc_hl_subrange_s hl_subrange[1];
|
||||
} packed_struct;
|
||||
} end_packed_struct;
|
||||
|
||||
#define USB_SIZEOF_ADC_HILO_RANGEPARM(nranges) (2+3*(nranges))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user