Questions tagged [macro]

7 questions
7
votes
1 answer

How to get rid of shift and logical operations

I am trying to upgrade an old firmware of a 32-bit MCU. The fw has many macros in it which uses various operations eg., logical shift etc. I want to replace these shift and logical operations. An example is the following macro. #define ERROR_BIT(x) …
homecloud
  • 139
  • 8
3
votes
1 answer

How to create unique label on macro definition on AVR GNU assembler?

On AVR GNU assembler I'm trying to create a label inside a macro definition. I would like to create a macro, which has a private lable, or unique label inside - just to be able to jump inside macro definition and use multiple instances of this…
Marcin Daw
  • 35
  • 4
3
votes
2 answers

Is there anything macro-like, in VHDL?

I have a little piece of code, that applies again and again, in different places. The places are too irregular, the code is too small, and the input and varies too much to be able to use an entity. Is there anything macro like in VHDL? for…
AMADANON Inc.
  • 486
  • 4
  • 15
3
votes
2 answers

#define EEMEM __attribute__((section('.eeprom')))

After long time investigation, I could not find proper information about #define EEMEM __attribute__((section('.eeprom'))) macro on eeprom.h header file. I want to declare variable exactly at address 0x0010 on Atmega128 EEPROM. Because, when I use…
Mamurbek
  • 35
  • 5
2
votes
2 answers

Microchip's pic-as throws syntax error on macro define

I have a file with a name like xxxx.asm in it I have: InitPORTA MACRO pic-as throws a syntax error on this line. The code compiled fine with: mpasmx -rdec pic-code.s I thought *.asm files were the file type that pic-as took to mean assembly with no…
Ken Smith
  • 234
  • 1
  • 7
1
vote
2 answers

Non-reentrant Functions as Macros for utilities used in both Main and Interrupts

When compiling software with xc8 for a PIC which has functions which are called in both interrupts and in the main function the compiler gives an advisory: non-reentrant function "foo" appears in multiple call graphs and has been duplicated by the…
Harry Beadle
  • 791
  • 3
  • 18
1
vote
1 answer

Macroscopic physical significance of Thermal Voltage in Diodes

Everywhere I search, the thermal voltage in diodes is described either as the microscopic property related to the average energy of electrons due to thermal motion The constant in the ideal diode equation. Now, I'd like to know the macroscopic…
ions me
  • 341
  • 1
  • 8