Browse files

Moved global defs to invididual files, dunno why I didn't do that fro…

…m the start really
  • Loading branch information...
1 parent f6fe857 commit ba8ed0a3453a8e73844614a1051d62ed82d42196 @jonsowman jonsowman committed Mar 26, 2012
Showing with 29 additions and 31 deletions.
  1. +0 −25 firmware/global.h
  2. +0 −1 firmware/gps.c
  3. +1 −1 firmware/led.c
  4. +5 −0 firmware/led.h
  5. +0 −2 firmware/main.c
  6. +1 −1 firmware/radio.c
  7. +22 −0 firmware/radio.h
  8. +0 −1 firmware/temperature.c
View
25 firmware/global.h
@@ -9,31 +9,6 @@
#ifndef __GLOBAL_H__
#define __GLOBAL_H__
-#define LED_DDR DDRB
-#define LED_PORT PORTB
-#define LED_RED 1
-#define LED_GREEN 0
-#define RADIO_EN 2
-#define RADIO_EN_DDR DDRC
-#define RADIO_EN_PORT PORTC
-
-#define RADIO_PORT PORTB
-#define RADIO_DDR DDRB
-#define RADIO_MOSI 3
-#define RADIO_MISO 4
-#define RADIO_SCK 5
-#define RADIO_SS 2
-
-#define RADIO_DAC_A 0
-#define RADIO_DAC_B 1
-#define RADIO_FINE RADIO_DAC_B
-#define RADIO_COARSE RADIO_DAC_A
-
-#define RADIO_BAUD_50 156
-#define RADIO_BAUD_300 26
-
-#define DSP_SAMPLES 50
-#define DSP_OFFSET 0
#endif /* __GLOBAL_H__ */
View
1 firmware/gps.c
@@ -10,7 +10,6 @@
#include <util/delay.h>
#include <stdbool.h>
#include "led.h"
-#include "global.h"
#include "gps.h"
#include "radio.h"
View
2 firmware/led.c
@@ -6,7 +6,7 @@
* Jon Sowman 2012
*/
#include <avr/io.h>
-#include "global.h"
+#include "led.h"
void led_init()
{
View
5 firmware/led.h
@@ -9,6 +9,11 @@
#ifndef __LED_H__
#define __LED_H__
+#define LED_DDR DDRB
+#define LED_PORT PORTB
+#define LED_RED 1
+#define LED_GREEN 0
+
void led_init();
void led_set();
View
2 firmware/main.c
@@ -17,7 +17,6 @@
#include "led.h"
#include "radio.h"
-#include "global.h"
#include "gps.h"
#include "temperature.h"
@@ -83,7 +82,6 @@ int main()
led_set(LED_RED, 0);
eeprom_update_dword(&ticks, tick);
wdt_reset();
- _delay_ms(1000);
}
return 0;
View
2 firmware/radio.c
@@ -14,7 +14,6 @@
#include <avr/eeprom.h>
#include <util/crc16.h>
#include "stdbool.h"
-#include "global.h"
#include "led.h"
#include "radio.h"
@@ -89,6 +88,7 @@ void radio_enable(void)
{
RADIO_EN_DDR |= _BV(RADIO_EN);
RADIO_EN_PORT |= _BV(RADIO_EN);
+ _delay_ms(100);
}
/**
View
22 firmware/radio.h
@@ -11,6 +11,28 @@
#include <avr/io.h>
+#define RADIO_EN 2
+#define RADIO_EN_DDR DDRC
+#define RADIO_EN_PORT PORTC
+
+#define RADIO_PORT PORTB
+#define RADIO_DDR DDRB
+#define RADIO_MOSI 3
+#define RADIO_MISO 4
+#define RADIO_SCK 5
+#define RADIO_SS 2
+
+#define RADIO_DAC_A 0
+#define RADIO_DAC_B 1
+#define RADIO_FINE RADIO_DAC_B
+#define RADIO_COARSE RADIO_DAC_A
+
+#define RADIO_BAUD_50 156
+#define RADIO_BAUD_300 26
+
+#define DSP_SAMPLES 50
+#define DSP_OFFSET 0
+
void radio_init(void);
void radio_enable(void);
void radio_disable(void);
View
1 firmware/temperature.c
@@ -8,7 +8,6 @@
#include <avr/io.h>
#include <stdio.h>
-#include "global.h"
#include "led.h"
#include "radio.h"
#include "i2c.h"

0 comments on commit ba8ed0a

Please sign in to comment.