Skip to main content
Associate III
Solved

Typedef struct error

Hi all

 

 
/*
 * usb_device.h
 *
 * Created on: Aug 5, 2025
 * Author: mmadha
 */


#ifndef USB_DEVICE_H_
#define USB_DEVICE_H_

#include "usb_standards.h"



struct UsbDevice
{
	/// \brief The current USB device state.
	UsbDeviceState device_state;
	/// \brief The current control transfer stage (for endpoint0).
	UsbControlTransferStage control_transfer_stage;
	/// \brief The selected USB configuration.
	uint8_t configuration_value;

	/** \defgroup UsbDeviceOutInBufferPointers
	 *@{*/
	void const *ptr_out_buffer;
	uint32_t out_data_size;
	void const *ptr_in_buffer;
	uint32_t in_data_size;
	/**@}*/
};

#endif /* USB_DEVICE_H_ */

 

 For some reason, I am getting the error Description Resource Path Location Type
expected ';', identifier or '(' before 'struct' usb_device.h /clk_test/Core/Inc line 16 C/C++ Problem

which I don't understand. Any suggestions on what could be causing this error would be greatly appreciated.

 

Kind regards

This topic has been closed for replies.
TDK
TDKBest answer

The issue is the content within the usb_standards.h file. The last statement in there, whatever it is, is missing ";". Whitespace is ignored so the error is caught on the next statement.

"If you feel a post has answered your question, please click ""Accept as Solution""."

3 replies

TDK

You missing a ; at the end of the usb_standards.h file.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Maaz1Author
Associate III

isn't that a preprocessor directive, so i dont need to add a ; at the end of it

TDK
TDKBest answer

The issue is the content within the usb_standards.h file. The last statement in there, whatever it is, is missing ";". Whitespace is ignored so the error is caught on the next statement.

"If you feel a post has answered your question, please click ""Accept as Solution""."