Skip to content
Permalink
Browse files

asm wire - added while loop

  • Loading branch information
martind
martind committed May 20, 2014
1 parent 143369f commit d3e74f1c447b178046306f63472ad7b91306e5f1
Showing with 29 additions and 1 deletion.
  1. +29 −1 wire/wire.ino
@@ -52,7 +52,7 @@ void loopSlow()
// PB1 = 9 BT_TXD

// Bluetooth <-> Servo Shield
void loop()
void loopBTver0()
{
asm volatile (
"cli" "\n\t" // disable interrupts
@@ -69,6 +69,34 @@ void loop()
::);
}

void loop()
{
asm volatile (
"cli" "\n\t" // disable interrupts
"1:"
"in r1, 0x3" "\n\t"

"sbis 0x3,0" "\n\t"
"cbi 0x5,3" "\n\t"
"sbic 0x3,0" "\n\t"
"sbi 0x5,3" "\n\t"

"sbis 0x3,4" "\n\t" // 1/2/3
"cbi 0x5,1" "\n\t" // 2
"sbic 0x3,4" "\n\t"
"sbi 0x5,1" "\n\t" // 2

"2:"
"in r0, 0x3" "\n\t" // 1
"eor r0, r1" "\n\t" // 1
"breq 2b" "\n\t" // 1/2

"rjmp 1b" "\n\t" // 2
::);
}



// setup BT
void loopSetupBT()
{

0 comments on commit d3e74f1

Please sign in to comment.
You can’t perform that action at this time.