Changeset - ccde21039881
[Not reviewed]
default
0 3 0
ethanzonca@CL-SEC241-08.cedarville.edu - 12 years ago 2012-11-15 15:57:13
ethanzonca@CL-SEC241-08.cedarville.edu
Added debug LED functionality to main code
3 files changed with 11 insertions and 11 deletions:
0 comments (0 inline, 0 general)
master/master/lib/led.c
Show inline comments
 
@@ -4,25 +4,25 @@
 
 * Created: 10/25/2012 3:34:03 PM
 
 *  Author: ethanzonca
 
 */ 
 
 
#include <avr/io.h>
 
 
void led_setup() {
 
	// Configure ports/pins for LEDs
 
	DDRA = 0xff;
 
	PORTA = 0x00;
 
}
 
 
void led_On(uint8_t led) {
 
void led_on(uint8_t led) {
 
	// Turn the specified LED on
 
	PORTA |= led;
 
}
 
 
void led_Off(uint8_t led) {
 
void led_off(uint8_t led) {
 
	// Turn the specified LED off
 
	PORTA &= ~(led);
 
}
 
 
void led_Toggle(uint8_t led) {
 
void led_toggle(uint8_t led) {
 
	// Toggle the specified LED 
 
}
 
\ No newline at end of file
master/master/lib/led.h
Show inline comments
 
@@ -6,18 +6,18 @@
 
 */ 
 
 
 
#ifndef LED_H_
 
#define LED_H_
 
 
#define POWER 1
 
#define ERROR 2
 
#define STAT 2
 
#define OK 2
 
 
void led_setup();
 
void led_On(uint8_t led);
 
void led_Off(uint8_t led);
 
void led_Toggle(uint8_t led);
 
void led_on(uint8_t led);
 
void led_off(uint8_t led);
 
void led_toggle(uint8_t led);
 
 
 
#endif /* LED_H_ */
master/master/master.c
Show inline comments
 
@@ -24,39 +24,39 @@
 

	
 
#include "lib/sd/sd_raw_config.h"
 

	
 
void micro_setup() {
 
	// Generic microcontroller config options
 

	
 
}
 

	
 

	
 
int main(void)
 
{
 
	// Initialize
 
	//micro_setup();
 
	micro_setup();
 
	led_setup();
 

	
 
	//serial_setup(); // Config serial ports
 
	
 
	logger_setup(); // this takes a few ms
 
	
 
	afsk_setup();
 
	while(afsk_busy());
 
    
 
	led_on(4);
 
	
 
	while(1)
 
    {
 
		led_on(2);
 
		logger_log("123,43,1,2,4,3\n");
 
		led_off(2);
 
		
 
		//afsk_test();
 

	
 
		// Wait for transmission to complete before starting another.
 
		// Hopefully this will never delay because it should issue on a timed schedule. Software timers!
 
		while(afsk_busy());
 
		aprs_send();
 

	
 

	
 
        //serial_SendCommand('0','A',0,0);
 
		
 
		
 
    }
 
}
 
\ No newline at end of file
0 comments (0 inline, 0 general)