Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Commit

Permalink
Support raw msp430g2231 and msp430g2211
Browse files Browse the repository at this point in the history
  • Loading branch information
tgtakaoka committed Mar 13, 2015
1 parent c2475dd commit 2e8209f
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 0 deletions.
35 changes: 35 additions & 0 deletions support/make/msp430g2211.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- mode: makefile-gmake; mode: flyspell-prog; -*-
#
# Copyright (C) 2010 Tadashi G. Takaoka
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

PLATFORM ?= msp430g2211

MSP_MCU = msp430x2211

# Disable MSP430 hardware multiply because it makes MSPGCC die
PFLAGS += -mdisable-hwmul
OPTFLAGS += -O

ifndef DEFAULT_PROGRAM
DEFAULT_PROGRAM = mspdebug
endif

$(call TOSMake_include_platform,msp)

msp430g2211: $(BUILD_DEPS)
@:

# vim: set noet ts=8 sw=8 syntax=make:
35 changes: 35 additions & 0 deletions support/make/msp430g2231.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- mode: makefile-gmake; mode: flyspell-prog; -*-
#
# Copyright (C) 2010 Tadashi G. Takaoka
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

PLATFORM ?= msp430g2231

MSP_MCU = msp430x2231

# Disable MSP430 hardware multiply because it makes MSPGCC die
PFLAGS += -mdisable-hwmul
OPTFLAGS += -O

ifndef DEFAULT_PROGRAM
DEFAULT_PROGRAM = mspdebug
endif

$(call TOSMake_include_platform,msp)

msp430g2231: $(BUILD_DEPS)
@:

# vim: set noet ts=8 sw=8 syntax=make:
51 changes: 51 additions & 0 deletions tos/platforms/msp430g2211/.platform
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# -*- mode:perl; -*-
#
# Copyright (C) 2010 Tadashi G. Takaoka
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

push( @includes, qw(
%T/platforms/msp430g2211
%T/platforms/msp430-common
%T/chips/msp430/msp430g2xx1
%T/chips/msp430/msp430x2xx
%T/chips/msp430/msp430x2xx/pins
%T/chips/msp430/msp430x2xx/timer
%T/chips/msp430/common
%T/chips/msp430/common/pins
%T/chips/msp430/common/timer
%T/chips/msp430
%T/chips/msp430/pins
%T/chips/msp430/timer16
%T/chips/msp430/timer
%T/lib/gpio
%T/lib/timer
%T/lib/power
%T/lib/misc
) );

@opts = qw(
-gcc=msp430-gcc
-mmcu=msp430x2211
-mno-stack-init
-fnesc-target=msp430
-fnesc-no-debug
);
push @opts, "-fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask" if !$with_scheduler_flag;
39 changes: 39 additions & 0 deletions tos/platforms/msp430g2211/hardware.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* -*- mode: c; mode: flyspell-prog; -*- */
/*
* Copyright (C) 2010 Tadashi G. Takaoka
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef _H_hardware_h
#define _H_hardware_h

#if !defined(__MSP430__REV__)
#define __MSP430_REV__ 'D'
#endif

#include "msp430hardware.h"

// LED
#define LED_RED Port10

#endif // _H_hardware_h

/*
* Local Variables:
* c-file-style: "bsd"
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
* vim: set et ts=4 sw=4:
*/
51 changes: 51 additions & 0 deletions tos/platforms/msp430g2231/.platform
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# -*- mode:perl; -*-
#
# Copyright (C) 2010 Tadashi G. Takaoka
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

push( @includes, qw(
%T/platforms/msp430g2231
%T/platforms/msp430-common
%T/chips/msp430/msp430g2xx1
%T/chips/msp430/msp430x2xx
%T/chips/msp430/msp430x2xx/pins
%T/chips/msp430/msp430x2xx/timer
%T/chips/msp430/common
%T/chips/msp430/common/pins
%T/chips/msp430/common/timer
%T/chips/msp430
%T/chips/msp430/pins
%T/chips/msp430/timer16
%T/chips/msp430/timer
%T/lib/gpio
%T/lib/timer
%T/lib/power
%T/lib/misc
) );

@opts = qw(
-gcc=msp430-gcc
-mmcu=msp430x2231
-mno-stack-init
-fnesc-target=msp430
-fnesc-no-debug
);
push @opts, "-fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask" if !$with_scheduler_flag;
39 changes: 39 additions & 0 deletions tos/platforms/msp430g2231/hardware.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* -*- mode: c; mode: flyspell-prog; -*- */
/*
* Copyright (C) 2010 Tadashi G. Takaoka
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef _H_hardware_h
#define _H_hardware_h

#if !defined(__MSP430__REV__)
#define __MSP430_REV__ 'D'
#endif

#include "msp430hardware.h"

// LED
#define LED_RED Port10

#endif // _H_hardware_h

/*
* Local Variables:
* c-file-style: "bsd"
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
* vim: set et ts=4 sw=4:
*/

0 comments on commit 2e8209f

Please sign in to comment.