-
Notifications
You must be signed in to change notification settings - Fork 6
/
mcp430.sconscript
83 lines (73 loc) · 3.13 KB
/
mcp430.sconscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!python
Import ("default_env")
from PlatformBaseClass import PlatformBaseClass
class Msp430Platform(PlatformBaseClass):
def Name(self):
return 'msp430'
def TargetNameList(self):
return [
self.Default(str(self._build_binaries['msp430_blink'])),
'msp430_blink_deploy',
self.Default(str(self._build_binaries['msp430_timed_blink'])),
'msp430_timed_blink_deploy',
self.Default(str(self._build_binaries['msp430_realtime_blink'])),
'msp430_realtime_blink_deploy'
]
def BuildList(self):
return [
'reacto',
'msp430_blink',
'msp430_timed_blink',
'msp430_realtime_blink'
]
def ProfileEnabled(self):
return False
def CppUTestExtensionsEnabled (self):
return False
def PostBuildTargets(self):
#
#
# Tests Build
# Use `scons tests` during deveopment, to print tests results and force
# build of everything.
msp430_b = Command( target = "msp430_blink",
source = self._build_binaries['msp430_blink'],
action = "msp430-size $SOURCE" )
msp430_b_deploy = Command( target = "msp430_blink_deploy",
source = [msp430_b, self._build_binaries['msp430_blink']],
action = "echo \"prog ${SOURCES[1]}\" | mspdebug rf2500" )
msp430_t = Command( target = "msp430_timed_blink",
source = self._build_binaries['msp430_timed_blink'],
action = "msp430-size $SOURCE" )
msp430_t_deploy = Command( target = "msp430_timed_blink_deploy",
source = [msp430_t, self._build_binaries['msp430_timed_blink']],
action = "echo \"prog ${SOURCES[1]}\" | mspdebug rf2500" )
msp430_r = Command( target = "msp430_realtime_blink",
source = self._build_binaries['msp430_realtime_blink'],
action = "msp430-size $SOURCE" )
msp430_r_deploy = Command( target = "msp430_realtime_blink_deploy",
source = [msp430_t, self._build_binaries['msp430_realtime_blink']],
action = "echo \"prog ${SOURCES[1]}\" | mspdebug rf2500" )
def _SetupEnv(self):
prefix = 'msp430-'
mcu_flag = '-mmcu=msp430g2452'
# mcu_flag = '-mmcu=msp430g2231'
self._env = default_env.Clone (
CC = prefix + 'gcc',
CXX = prefix + "g++",
LD = prefix + "g++",
AR = prefix + "ar",
AS = prefix + "gcc",
STRIP = prefix + "strip",
RANLIB = prefix + "ranlib",
CPPDEFINES = ['REACTO_DISABLE_LOGGING'],
CFLAGS = [mcu_flag, ],
ASFLAGS = [mcu_flag, '-x', 'assembler-with-cpp', '-Wa,-gstabs' ],
CPPFLAGS = ['-g', '-Os', '-Wall'],
LINKFLAGS = [mcu_flag,
],
CINCLUDES = [],
CXXINCLUDES = [],
)
instance = Msp430Platform()
Return('instance')