Hallo liebe Community,
wieso funktioniert folgender Aufruf nicht?
In der cpp-Datei
bool Configuration :: DMX_Config_method ( Configuration*
DMX_Config_struct ) {
DMX_Config_struct -> DMX_Config.baudrate = 250000;
return true;
};
In der h-Datei
#ifndef CONFIGURATION_H_
#define CONFIGURATION_H_
#include "mbed.h"
class Configuration {
private:
public:
Configuration ( void );
~ Configuration ( void );
bool DMX_Config_method ( Configuration* DMX_Config_struct );
struct DMX_Config {
unsigned int baudrate;
unsigned int bits;
unsigned int stopbits;
SerialBase :: Parity parity;
PinName pin_RX;
PinName pin_TX;
};
};
#endif
Error:Error: Type name is not allowed in
"Configuration/Configuration.cpp", Line: 11, Col: 27
LG Christian
Was soll das darstellen?
1 | bool DMX_Config_method ( Configuration* DMX_Config_struct ); |
eventuell erst mal den Syntax der Sprache richtig verwenden. Vermutlich gibt es dafür auch eine Warnung
mist - man sollte nicht 2 dinge gleichzeitig machen - bitte den letzten post (stillschweigend ignorieren)
Christian K. schrieb: > struct DMX_Config { > > unsigned int baudrate; > unsigned int bits; > unsigned int stopbits; > > SerialBase :: Parity parity; > > PinName pin_RX; > PinName pin_TX; > }; Falsch. Richtig wäre: struct { unsigned int baudrate; unsigned int bits; unsigned int stopbits; SerialBase :: Parity parity; PinName pin_RX; PinName pin_TX; } DMX_Config; Dann klappt das auch mit DMX_Config_struct -> DMX_Config.baudrate = 250000;
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.