Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
eric
PostPosted: Nov 05, 2002 - 06:25 PM
Newbie


Joined: Oct 28, 2001
Posts: 0


VC is wrong. GCC is correctly pointing out a syntax error.

phys_audio_out is defined as a 2-dimensional array, or said another way, an array of arrays. When initializing this variable, the data must take on the same type structure of the variable. The data that you have is a 1-dimensional array, which is not the same type as the variable. Change the declaration to below:

#define MAX_OUT 3
#define NUM_AUD_LVLS 2

static const unsigned char phys_audio_out[MAX_OUT][NUM_AUD_LVLS]=
{
{0x1F, 0x20},
{0x21, 0x12},
{0x13, 0x24}
};

So now you have phys_audio_out declared as a 3-element array with each element being a 2-element array of constant unsigned character. The data initializer now matches the type.

Eric
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits