diff options
author | Bernhard Tittelbach <xro@realraum.at> | 2012-06-22 02:19:00 +0000 |
---|---|---|
committer | Bernhard Tittelbach <xro@realraum.at> | 2012-06-22 02:19:00 +0000 |
commit | 722202c477817732716c29f00b37f754b7abf3a6 (patch) | |
tree | b2ba8384a2ea9a13266a55fe4aba0107ff400fdf /software/hhd70dongle/hhd70.c | |
parent | moved cmd flags to own byte (diff) |
rx detect works, still receiving mostly noise
git-svn-id: https://svn.spreadspace.org/mur.sat@550 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/hhd70dongle/hhd70.c')
-rw-r--r-- | software/hhd70dongle/hhd70.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/software/hhd70dongle/hhd70.c b/software/hhd70dongle/hhd70.c index 6b2ce5f..9b79797 100644 --- a/software/hhd70dongle/hhd70.c +++ b/software/hhd70dongle/hhd70.c @@ -37,7 +37,7 @@ void hhd70_init(void) { //configure Direction of SS / PB0 , MOSI and SCLK as Output to drive CS of CC1101 SPI_DDR = (1<<MOSI)|(1<<SCK)|(1<<CS)|(1<<RE)|(1<<TE); - SPI_PORT = (1<<CS) | (1<<RE) | (1<<TE); + SPI_PORT = (1<<CS) | (1<<RE) | (1<<TE) | (1<<GDO2); SPCR = (1<<SPE)|(1<<MSTR); // | (0<<DORD) //select MSB first: DORD == 0 // SPSR = (0<<SPI2X) // f_osc/4 // SPSR = (1<<SPI2X) // f_osc/2 @@ -107,5 +107,6 @@ void hhd70_palna_off(void) int8_t hhd70_rx_data_available(void) { - return SPI_PINB_REG & (1 << GDO2); + //check if GDO2 pin has been pulled low by c1101 + return (SPI_PINB_REG & (1 << GDO2)) == 0; }
\ No newline at end of file |