[an error occurred while processing this directive]
[an error occurred while processing this directive]
|
Объясните пожалуйста может ли define возвращать параметр
VisualDSP 7.0 + SP1
--------------файл sprt.h---------------
/************************************************************************
*
* sport.h
*
* (c) Copyright 2000 Analog Devices, Inc. All rights reserved.
*
************************************************************************/
#ifndef __SPORT_DEFINED
#define __SPORT_DEFINED
#if __cplusplus
extern "C" {
#endif
int sport_start(int);
int sport_stop(int);
int sport_read(int);
int sport_write(int, int);
#if __cplusplus
}
#endif
/*
* This file contains macros and subroutines to support the
* serial ports of the ADSP-21xx digital signal processors.
*/
/*
* This macro reads a value from the RX0 or RX1 registers.
*/
#define sport_read(a) \
({ int __sport_value; \
if (a == 0) \
asm volatile ("%0=RX0;" : "=d" (__sport_value)); \
else \
asm volatile ("%0=RX1;" : "=d" (__sport_value)); \
__sport_value;})
#endif
--------------файл main.c---------------
#include "sport.h"
void main(void)
{
int v1,v2;
.........
v2 = sport_read(v1);
}
".\MAIN.C", line 15: error #29: expected an expression
v2 = sport_read(v1);
^
E-mail: info@telesys.ru