Project

General

Profile

Revision 1036

Updated Makefile for Diagnostic Station directory. Now have compilable code which can be successfully downloaded to turn on 1 orb light!

View differences:

branches/diagnosticStation/stationCode/v1/main.c
1 1
#include <dragonfly_lib.h>
2
#include <wireless.h>
3 2
#include <encoders.h>
4 3

  
5
#define CHAN 0xE	/* channel to use for wireless communication */
6
#define TEST 1		/* group and type numbers for sending test packets */
7

  
8
void packet_receive(char type, int source, unsigned char* packet, int length);
9

  
10 4
int main(void)
11 5
{
12
	/* initialize components, set wireless channel */
6
	/* initialize components */
13 7
	dragonfly_init(ALL_ON);
14
	wl_init();
15
	wl_set_channel(CHAN);
16 8
	orb_enable();
17 9

  
18
	/* set up a packet group (or something) to receive packets */
19
	wl_register_packet_group(&packet_receive);
10
	orb1_set_color(ORANGE);
20 11

  
21
	while (1)
22
	{
23
		wl_do();
24

  
25
		/* send a packet with no usefull info for testing */
26
		wl_send_global_packet(TEST, TEST, NULL, 0, 0);
27
	}
28

  
29
	wl_terminate();
30

  
31 12
	return 0;
32 13
}
33

  
34
void packet_receive(char type, int source, unsigned char* packet, int length)
35
{
36
	orb_set_color(type);
37
}
38

  
branches/diagnosticStation/stationCode/v1/Makefile
4 4

  
5 5
# Relative path to the root directory (containing lib directory)
6 6
ifndef COLONYROOT
7
COLONYROOT = ../../../..
7
COLONYROOT = ../..
8 8
endif
9 9

  
10 10
# Target file name (without extension).
11
TARGET = template
11
TARGET = main
12 12

  
13 13
# Uncomment this to use the wireless library
14 14
USE_WIRELESS = 1
......
116 116
endif
117 117

  
118 118
# Place -I, -L options here
119
CINCS = -I$(COLONYROOT)/code/lib/include/libdragonfly
120
CINCS += -L$(COLONYROOT)/code/lib/bin
119
CINCS = -I$(COLONYROOT)/lib/include/libdragonfly
120
CINCS += -L$(COLONYROOT)/lib/bin
121 121
ifdef USE_WIRELESS
122
	CINCS += -I$(COLONYROOT)/code/lib/include/libwireless
122
	CINCS += -I$(COLONYROOT)/lib/include/libwireless
123 123
endif
124 124

  
125 125
#---------------- Compiler Options ----------------

Also available in: Unified diff