From f229502d9addacfbefe955a47931b980bfbb1a10 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 23 Aug 2009 08:37:11 +0000 Subject: Fixed AVRISP programmer demo -- can now connect to a target and read/write Sig/Lock/Fuse/OSCCAL bytes successfully. Changed SPI_Init() to allow for the clock polarity and data sample modes to be set. Changed Dataflash_Init() to no longer call SPI_Init() automatically. --- Demos/Device/ClassDriver/MassStorage/MassStorage.c | 3 ++- Demos/Device/LowLevel/MassStorage/MassStorage.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'Demos/Device') diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.c b/Demos/Device/ClassDriver/MassStorage/MassStorage.c index 52ed2d938..4092680c4 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.c +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.c @@ -84,7 +84,8 @@ void SetupHardware(void) /* Hardware Initialization */ LEDs_Init(); - Dataflash_Init(SPI_SPEED_FCPU_DIV_2); + SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_SCK_LEAD_FALLING | SPI_SAMPLE_TRAILING | SPI_MODE_MASTER); + Dataflash_Init(); USB_Init(); /* Clear Dataflash sector protections, if enabled */ diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c index 1a2d8d468..cf276fd81 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.c +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c @@ -75,7 +75,8 @@ void SetupHardware(void) /* Hardware Initialization */ LEDs_Init(); - Dataflash_Init(SPI_SPEED_FCPU_DIV_2); + SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_SCK_LEAD_FALLING | SPI_SAMPLE_TRAILING | SPI_MODE_MASTER); + Dataflash_Init(); USB_Init(); /* Clear Dataflash sector protections, if enabled */ -- cgit v1.2.3