AnsweredAssumed Answered

Optimization of changing bit on port

Question asked by wanger.jerry on May 11, 2014
Latest reply on May 11, 2014 by Clive One
Can the following code be made more efficient other than not having a function. Using a STMF405 and all I am trying to do is set bit 14 on Port C.

#define GPIOC                                0x40020800
#define GPIOC_BSRR_OFFSET   0x18
#define BIT14_ON                         0x00004000
#define GPIOC_BSRR_ADDRESS  GPIOC +  GPIOC_BSRR_OFFSET

unsigned int volatile * GPIOC_BSRR = (unsigned int *)GPIOC_BSRR_ADDRESS;
void rx_tx_on(void)
{
  *GPIOC_BSRR = BIT14_ON;
}

Outcomes