#GCCINC=-T ldscripts/161x.x
GCCINC=-T ldscripts/$(mcu).x
-CCEXTRA?=
-CC=msp430-gcc -Wall -Os -fno-strict-aliasing -g -mmcu=$(mcu) -D$(mcu) -D$(platform) -Dplatform=$(platform) -DGCC $(GCCINC) -I include -I platforms $(CCEXTRA)
+CCEXTRA?= -D$(mcu) -D$(platform) -Dplatform=$(platform) -DGCC $(GCCINC) -I include -I platforms
+GCC?=msp430-gcc
+CC=$(GCC) -Wall -Os -fno-strict-aliasing -g -mmcu=$(mcu) $(CCEXTRA)
# Available Applications
# ======================
break;
case MONITOR_DIR:
- P5DIR=cmddata[0];
- txdata(app,verb,1);
- break;
+ //P5DIR=cmddata[0];
+ debugstr("Command deprecated.");
+ txdata(app,verb,1);
+ break;
case MONITOR_IN:
- cmddata[0]=P5IN;
- txdata(app,verb,1);
- break;
+ //cmddata[0]=P5IN;
+ debugstr("Command deprecated.");
+ txdata(app,verb,1);
+ break;
case MONITOR_OUT:
- P5OUT=cmddata[0];
- txdata(app,verb,1);
- break;
+ //P5OUT=cmddata[0];
+ debugstr("Command deprecated.");
+ txdata(app,verb,1);
+ break;
case MONITOR_SILENT:
silent=cmddata[0];
#ifndef GFPORTS
#define GFPORTS
-#include <io.h>
+//#include <io.h>
+
// N.B., only asm-clean CPP definitions allowed.
#include "command.h"
#include "app.h"
-#include <signal.h>
-#include <io.h>
-#include <iomacros.h>
-
#define GLITCH 0x71
//Command codes
#include "gfports.h"
-#include <signal.h>
+#include <stdint.h>
+
+#ifdef MSP430
#include <io.h>
+#include <signal.h>
#include <iomacros.h>
-#include <stdint.h>
+
+#endif
#include "config.h"
--- /dev/null
+//! MSP430F1612/1611 clock and I/O definitions
+
+#include "platform.h"
+
+//! Receive a byte.
+unsigned char serial0_rx(){
+ return 0;
+}
+
+//! Receive a byte.
+unsigned char serial1_rx(){
+ return 0;
+}
+
+//! Transmit a byte.
+void serial0_tx(unsigned char x){
+}
+
+//! Transmit a byte on the second UART.
+void serial1_tx(unsigned char x){
+}
+
+//! Set the baud rate.
+void setbaud0(unsigned char rate){
+
+ //http://mspgcc.sourceforge.net/baudrate.html
+ switch(rate){
+ case 1://9600 baud
+
+ break;
+ case 2://19200 baud
+
+ break;
+ case 3://38400 baud
+
+ break;
+ case 4://57600 baud
+
+ break;
+ default:
+ case 5://115200 baud
+
+ break;
+ }
+}
+
+//! Set the baud rate of the second uart.
+void setbaud1(unsigned char rate){
+ //http://mspgcc.sourceforge.net/baudrate.html
+ switch(rate){
+ case 1://9600 baud
+
+ break;
+ case 2://19200 baud
+
+ break;
+ case 3://38400 baud
+
+ break;
+ case 4://57600 baud
+
+ break;
+ default:
+ case 5://115200 baud
+
+ break;
+ }
+}
+
+
+void msp430_init_uart0(){
+}
+
+
+void msp430_init_uart1(){
+}
+
+
+
+//! Initialization is correct.
+void msp430_init_dco_done(){
+ //Nothing to do for the 1612.
+}
+
+
+void msp430_init_dco() {
+
+}
+
delaying slightly longer than requested. */
void prep_timer()
{
+ #ifdef MSP430
BCSCTL2 = 0x00; /* In particular, use DCOCLK as SMCLK source with
divider 1. Hence, Timer B ticks with system
clock at 16 MHz. */
TBCTL = 0x0204; /* Driven by SMCLK; disable Timer B interrupts;
reset timer in case it was previously in use */
+ #else
+ #warning "Function unimplemented for this platform."
+ #endif
}
//! Delay for specified number of milliseconds (given 16 MHz clock)
void delay_ms( unsigned int ms )
{
+ #ifdef MSP430
// 16000 ticks = 1 ms
TBCTL |= 0x20; // Start timer!
while (ms--) {
TBCTL = 0x0224;
}
TBCTL = 0x0204; // Reset Timer B, till next time
+ #else
+ #warning "Function unimplemented for this platform."
+ #endif
}
//! Delay for specified number of microseconds (given 16 MHz clock)
void delay_us( unsigned int us )
{
+ #ifdef MSP430
// 16 ticks = 1 us
TBCTL |= 0x20; // Start timer!
while (us--) {
TBCTL = 0x0224;
}
TBCTL = 0x0204; // Reset Timer B, till next time
+ #else
+ #warning "Function unimplemented for this platform."
+ #endif
}
//! Delay for specified number of clock ticks (16 MHz clock implies 62.5 ns per tick).
void delay_ticks( unsigned int num_ticks )
{
+ #ifdef MSP430
TBCTL |= 0x20; // Start timer
while (TBR < num_ticks)
asm( "nop" );
TBCTL = 0x0204; // Reset Timer B, till next time
+ #else
+ #warning "Function unimplemented for this platform."
+ #endif
}