projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Monitor peeks work on the console.
[goodfet]
/
firmware
/
apps
/
avr
/
avr.c
diff --git
a/firmware/apps/avr/avr.c
b/firmware/apps/avr/avr.c
index
a127ea2
..
53d9f30
100644
(file)
--- a/
firmware/apps/avr/avr.c
+++ b/
firmware/apps/avr/avr.c
@@
-11,37
+11,39
@@
#include <iomacros.h>
#include "avr.h"
#include <iomacros.h>
#include "avr.h"
-#include "glitch.h"
+
//
#include "glitch.h"
//! Setup the AVR pins.
void avrsetup(){
spisetup();
//! Setup the AVR pins.
void avrsetup(){
spisetup();
-
- glitchsetup();
}
//! Initialized an attached AVR.
void avrconnect(){
//set I/O pins
}
//! Initialized an attached AVR.
void avrconnect(){
//set I/O pins
- avrsetup();
+ avrsetup(); //Cut this?
+
+ SETSS;
+ delay(50);
//Pulse !RST (SS) at least twice while CLK is low.
CLRCLK;
CLRSS;
//Pulse !RST (SS) at least twice while CLK is low.
CLRCLK;
CLRSS;
+ delay(5);
SETSS;
CLRCLK;
SETSS;
CLRCLK;
- delay(5
00
);
+ delay(5);
CLRSS;
CLRSS;
- delay(5
00
);
+ delay(5);
//Enable programming
avr_prgen();
}
//! Read and write an SPI byte with delays.
//Enable programming
avr_prgen();
}
//! Read and write an SPI byte with delays.
-u
nsigned char avrtrans8(unsigned char
byte){
- register u
nsigned int
bit;
+u
8 avrtrans8(u8
byte){
+ register u
16
bit;
//This function came from the SPI Wikipedia article.
//Minor alterations.
//This function came from the SPI Wikipedia article.
//Minor alterations.
@@
-135,7
+137,6
@@
void avrhandle(unsigned char app,
unsigned long len){
unsigned long i;
unsigned int at;
unsigned long len){
unsigned long i;
unsigned int at;
- static u8 connected=0;
/*
if(!avr_isready() && connected)
/*
if(!avr_isready() && connected)
@@
-153,9
+154,10
@@
void avrhandle(unsigned char app,
avrsetup();
txdata(app,verb,0);
break;
avrsetup();
txdata(app,verb,0);
break;
- case START:
//returns device code
+ case START:
avrconnect();
avrconnect();
- //no break here
+ txdata(app,verb,0);
+ break;//Used to fall through here.
case AVR_PEEKSIG:
for(i=0;i<4;i++)
cmddata[i]=avr_sig(i);
case AVR_PEEKSIG:
for(i=0;i<4;i++)
cmddata[i]=avr_sig(i);