0 favorites     0 comments    96 visits

See also...


Keywords

electronics
stupidity
AVR
logic analyzer
code optimization


Authorizations, license

Visible by: Everyone
All rights reserved

96 visits


Starting values - overview

Starting values - overview
By accident I had observed that the runtime gets longer and longer. See here as well.

Code excerpt:

if(bit <= 7) { // read data-bits 0...7
if( (PINA & _BV(PA0)) ) {
soft_uart_rx_byte |= _BV(bit);
} else {
soft_uart_rx_byte &= ~_BV(bit);
}
[...]

As shown here, the _BV(bit) part gets turned into a loop. As 'bit' is a variable, it can't be replaced by a number at compile time. And the loop gets longer for higher bits.

Comments

Sign-in to write a comment.