[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Using PORTB with variables, PORTB = var
From: |
Ben Jackson |
Subject: |
Re: [avr-gcc-list] Using PORTB with variables, PORTB = var |
Date: |
Sat, 22 Apr 2006 11:34:57 -0700 |
User-agent: |
Mutt/1.5.6i |
> void change() {
> var <<= 1;
> }
That's a shift, not a rotation, so var is going to become 0.
> while (1) {
> int var=1;
> while (var != 0) {
> PORTB = var;
> var <<= 1;
> }
> }
Also, 'int var' is going to be 16 bits wide, so in this version which
rotates the bit it's going to spend half its time in high bits and
PORTB is going to be 0.
- Re: [avr-gcc-list] Using PORTB with variables, PORTB = var, (continued)
- Re: [avr-gcc-list] Using PORTB with variables, PORTB = var, Abdul Malik Khan, 2006/04/22
- Re: [avr-gcc-list] Using PORTB with variables, PORTB = var, Lars Noschinski, 2006/04/22
- Re: [avr-gcc-list] Using PORTB with variables, PORTB = var, unauthorized, 2006/04/22
- Re: [avr-gcc-list] Using PORTB with variables, PORTB = var, Steve Meliza, 2006/04/22
- Re: [avr-gcc-list] Using PORTB with variables, PORTB = var, Kevin Cozens, 2006/04/22
- Re: [avr-gcc-list] Using PORTB with variables, PORTB = var, Ned Konz, 2006/04/22
- Re: [avr-gcc-list] Using PORTB with variables, PORTB = var,
Ben Jackson <=