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

Add formulae for MSP430 development: llvm-msp430, mspdebug #2336

Closed
wants to merge 13 commits into from
40 changes: 40 additions & 0 deletions Library/Formula/llvm-msp430.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
require 'formula'

class LlvmMsp430 <Formula
homepage 'https://www.fooe.net/trac/llvm-msp430/wiki'
head 'https://www.fooe.net/svn/llvm-msp430/trunk'
# Tarballs are not offered as of this writing.

keg_only <<-KEG.undent
This brew builds its own 'clang' and 'llvm',
which conflict with XCode and the llvm formula.
KEG

def download_strategy
SubversionDownloadStrategy
end

def install
system "make all"
prefix.install Dir['build/*']
end

def caveats
<<-EOS.undent
Since this package is keg-only, you must run build commands using something like:

PATH=#{bin}:$PATH make

You may use:

PATH=`brew --prefix llvm-msp430`/bin

to get the appropiate PATH that will continue to work if versions change.

The following websites may be helpful for building your project:

http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_Mac_OS_X
https://www.fooe.net/trac/llvm-msp430
EOS
end
end
51 changes: 51 additions & 0 deletions Library/Formula/mspdebug.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
require 'formula'

class Mspdebug <Formula
url 'http://downloads.sourceforge.net/project/mspdebug/mspdebug-0.10.tar.gz'
md5 '6537f6666451a82422d6a5b01ba48e9c'
homepage 'http://mspdebug.sf.net/'
head 'git://mspdebug.git.sourceforge.net/gitroot/mspdebug/mspdebug'

depends_on 'libusb'
depends_on 'libusb-compat'
depends_on 'libelf'

def patches
# Without this patch, mspdebug hangs when trying
# to open a connection to a TI LaunchPad.
# see: http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/p/18554/212659.aspx#212659
DATA
end

def install
ENV["PREFIX"] = prefix
inreplace "Makefile", "/opt", "/usr" # Don't assume MacPorts. (May not be necessary.)
system "make install"
end

def caveats
<<-EOS.undent
If you're using a RF2500-like device like the TI LaunchPad, you must
install a codeless kext for the device to be recognized by mspdebug.

More information is available at http://mspdebug.sourceforge.net/download.html.
EOS
end
end

__END__
diff --git a/rf2500.c b/rf2500.c
index ac27dcd..70a69b8 100644
--- a/rf2500.c
+++ b/rf2500.c
@@ -212,10 +212,5 @@ transport_t rf2500_open(const char *devpath)
return NULL;
}

- /* Flush out lingering data */
- while (usb_bulk_read(tr->handle, USB_FET_IN_EP,
- buf, sizeof(buf),
- 100) >= 0);
-
return (transport_t)tr;
}