projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
turn ftdi driver into echo server
[goodfet]
/
firmware
/
apps
/
monitor
/
monitor.c
diff --git
a/firmware/apps/monitor/monitor.c
b/firmware/apps/monitor/monitor.c
index
4f36833
..
db8749c
100644
(file)
--- a/
firmware/apps/monitor/monitor.c
+++ b/
firmware/apps/monitor/monitor.c
@@
-7,18
+7,20
@@
#include "platform.h"
#include "monitor.h"
#include "builddate.h"
#include "platform.h"
#include "monitor.h"
#include "builddate.h"
+
+
#if (platform == tilaunchpad)
#include <setjmp.h>
extern jmp_buf warmstart;
#if (platform == tilaunchpad)
#include <setjmp.h>
extern jmp_buf warmstart;
-
#endif
#endif
+
#define MONITOR_APP
//! Handles a monitor command.
void monitor_handle_fn(uint8_t const app,
#define MONITOR_APP
//! Handles a monitor command.
void monitor_handle_fn(uint8_t const app,
-
uint8_t const verb,
-
uint32_t const len);
+ uint8_t const verb,
+ uint32_t const len);
//! Overwrite all of RAM with 0xBEEF, then reboot.
void monitor_ram_pattern();
//! Overwrite all of RAM with 0xBEEF, then reboot.
void monitor_ram_pattern();
@@
-64,7
+66,6
@@
void monitor_handle_fn(uint8_t const app,
case MONITOR_ECHO:
//Echo back the same buffer.
case MONITOR_ECHO:
//Echo back the same buffer.
- debugstr("About to monitor echo.");
txdata(app,verb,len);
break;
txdata(app,verb,len);
break;
@@
-146,11
+147,11
@@
void monitor_handle_fn(uint8_t const app,
debugstr("Command deprecated.");
txdata(app,verb,1);
break;
debugstr("Command deprecated.");
txdata(app,verb,1);
break;
-
+
case MONITOR_SILENT:
case MONITOR_SILENT:
-
silent=cmddata[0];
-
txdata(app,verb,1);
-
break;
+ silent=cmddata[0];
+ txdata(app,verb,1);
+ break;
case MONITOR_CONNECTED:
#ifdef MSP430
case MONITOR_CONNECTED:
#ifdef MSP430
@@
-158,6
+159,33
@@
void monitor_handle_fn(uint8_t const app,
#endif
txdata(app,verb,0);
break;
#endif
txdata(app,verb,0);
break;
+
+ case MONITOR_LEDTEST:
+ //debugstr("Enter LEDTEST.");
+ i = 0;
+ #ifdef PLEDOUT
+ i++;
+ led_init();
+ led_on();
+ msdelay(5000);
+ led_off();
+ #endif
+ #ifdef PLED2OUT
+ i++;
+ led2_on();
+ msdelay(5000);
+ led2_off();
+ #endif
+ #ifdef PLED3OUT
+ i++;
+ led3_on();
+ msdelay(5000);
+ led3_off();
+ #endif
+ cmddata[0] = i; //Return number of LEDs that we flashed.
+ txdata(app,verb,1);
+ break;
+
}
}
}
}
@@
-197,9
+225,13
@@
unsigned int monitor_ram_depth()
//! Call a function by address.
int fncall(unsigned int adr)
{
//! Call a function by address.
int fncall(unsigned int adr)
{
+ #ifdef MSP430
int (*machfn)() = 0;
machfn = (int (*)()) adr;
return machfn();
int (*machfn)() = 0;
machfn = (int (*)()) adr;
return machfn();
+ #else
+ debugstr("fncall() not supported on this platform.");
+ #endif
}
}