Jump to content

    
Sign in to follow this  
jenya7

Как это записать в IAR

Recommended Posts

В кейле

typedef struct 
{
	TEmo_Bemfpar_Cfg emocfg_BEMF;
	// additional parameters that can be saved
	uint16 spike_filt;
	uint16 blank_filt;
}Tdatastruct_BEMF;

extern const Tdatastruct_BEMF dataset0 __attribute__((at(0x11008000)));
extern const Tdatastruct_BEMF dataset1 __attribute__((at(0x11008080)));

я правильно понимаю что в  IAR надо так?

extern const Tdatastruct_BEMF dataset0 @ 0x11008000;
extern const Tdatastruct_BEMF dataset1 @ 0x11008080;

 

Edited by jenya7

Share this post


Link to post
Share on other sites

В кейле такое проходит

const TEmo_Hallpar_Cfg dataset0 =
{
	/* PWM_Frequency */
  (float)	BCHALL_PWM_FREQ,
	/* PolePair */	
	(uint16) BCHALL_POLE_PAIRS,
	/* initDutyCycle */	
	(uint16) BCHALL_INIT_DUTY,
	/* inputA */	
	(uint16) BCHALL_INPUT_A,
	/* inputB */	
	(uint16) BCHALL_INPUT_B,
	/* inputC */	
	(uint16) BCHALL_INPUT_C,
  };

extern const TEmo_Hallpar_Cfg dataset0 __attribute__((at(0x1100E000)));

IAR ругается

const TEmo_Hallpar_Cfg dataset0 =
{
	/* PWM_Frequency */
  (float)	BCHALL_PWM_FREQ,
	/* PolePair */	
	(uint16) BCHALL_POLE_PAIRS,
	/* initDutyCycle */	
	(uint16) BCHALL_INIT_DUTY,
	/* inputA */	
	(uint16) BCHALL_INPUT_A,
	/* inputB */	
	(uint16) BCHALL_INPUT_B,
	/* inputC */	
	(uint16) BCHALL_INPUT_C,
  };

extern const TEmo_Hallpar_Cfg dataset0 @ 0x1100E000;

получается адрес надо подсовывать на уровне инициализации структуры?

const TEmo_Hallpar_Cfg dataset0 @ 0x1100E000 =
{
	/* PWM_Frequency */
  (float)	BCHALL_PWM_FREQ,
	/* PolePair */	
	(uint16) BCHALL_POLE_PAIRS,
	/* initDutyCycle */	
	(uint16) BCHALL_INIT_DUTY,
	/* inputA */	
	(uint16) BCHALL_INPUT_A,
	/* inputB */	
	(uint16) BCHALL_INPUT_B,
	/* inputC */	
	(uint16) BCHALL_INPUT_C,
  };

extern const TEmo_Hallpar_Cfg dataset0;

 

Edited by jenya7

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this