Merge pull request #121 from oliverschmidt/master

Several minor adjustments.
This commit is contained in:
Oliver Schmidt 2013-02-08 17:04:04 -08:00
commit c7f986faf5
4 changed files with 39 additions and 39 deletions

View file

@ -70,9 +70,9 @@ static struct ctk_button savebutton =
static struct ctk_button cancelbutton = static struct ctk_button cancelbutton =
{CTK_BUTTON(20, 13, 6, "Cancel")}; {CTK_BUTTON(20, 13, 6, "Cancel")};
PROCESS(dhcp_process, "IP Config"); PROCESS(ipconfig_process, "IP config");
AUTOSTART_PROCESSES(&dhcp_process); AUTOSTART_PROCESSES(&ipconfig_process);
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
static char * static char *
@ -170,15 +170,15 @@ static void
app_quit(void) app_quit(void)
{ {
ctk_window_close(&window); ctk_window_close(&window);
process_exit(&dhcp_process); process_exit(&ipconfig_process);
LOADER_UNLOAD(); LOADER_UNLOAD();
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
PROCESS_THREAD(dhcp_process, ev, data) PROCESS_THREAD(ipconfig_process, ev, data)
{ {
PROCESS_BEGIN(); PROCESS_BEGIN();
ctk_window_new(&window, 29, 14, "IP Config"); ctk_window_new(&window, 29, 14, "IP config");
CTK_WIDGET_ADD(&window, &requestbutton); CTK_WIDGET_ADD(&window, &requestbutton);
CTK_WIDGET_ADD(&window, &statuslabel); CTK_WIDGET_ADD(&window, &statuslabel);
@ -200,7 +200,7 @@ PROCESS_THREAD(dhcp_process, ev, data)
ctk_window_open(&window); ctk_window_open(&window);
/* Allow resolver to set DNS server address. */ /* Allow resolver to set DNS server address. */
process_post(PROCESS_CURRENT(), PROCESS_EVENT_MSG, NULL); PROCESS_PAUSE();
dhcpc_init(uip_ethaddr.addr, sizeof(uip_ethaddr.addr)); dhcpc_init(uip_ethaddr.addr, sizeof(uip_ethaddr.addr));

View file

@ -51,9 +51,9 @@ ifdef PLATFORM_BUILD
CONTIKI_TARGET_SOURCEFILES += dll-loader.c CONTIKI_TARGET_SOURCEFILES += dll-loader.c
CFLAGS += -DPLATFORM_BUILD -DWITH_GUI -DWITH_LOADER_ARCH -DAUTOSTART_ENABLE CFLAGS += -DPLATFORM_BUILD -DWITH_GUI -DWITH_LOADER_ARCH -DAUTOSTART_ENABLE
LDFLAGS += -Wl,--out-implib=contiki-main.$(TARGET).a \ LDFLAGS += -Wl,--out-implib=contiki-main.$(TARGET).a \
-u _cfs_open -u _cfs_opendir -u _uiplib_ipaddrconv -u _cfs_open -u _cfs_opendir -u _uiplib_ip4addrconv
LINKFLAGS = -implib:contiki-main.$(TARGET).a $(OBJECTDIR)/program-handler.o \ LINKFLAGS = -implib:contiki-main.$(TARGET).a $(OBJECTDIR)/program-handler.o \
-include:_cfs_open -include:_cfs_opendir -include:_uiplib_ipaddrconv -include:_cfs_open -include:_cfs_opendir -include:_uiplib_ip4addrconv
else else
CONTIKI_TARGET_SOURCEFILES += unload.c CONTIKI_TARGET_SOURCEFILES += unload.c
endif endif

View file

@ -50,11 +50,11 @@ typedef unsigned short uip_stats_t;
#define UIP_CONF_MAX_CONNECTIONS 40 #define UIP_CONF_MAX_CONNECTIONS 40
#define UIP_CONF_MAX_LISTENPORTS 40 #define UIP_CONF_MAX_LISTENPORTS 40
#define UIP_CONF_BUFFER_SIZE 420 #define UIP_CONF_BUFFER_SIZE 1514
#define UIP_CONF_BYTE_ORDER UIP_LITTLE_ENDIAN #define UIP_CONF_BYTE_ORDER UIP_LITTLE_ENDIAN
#define UIP_CONF_TCP_SPLIT 1 #define UIP_CONF_TCP_SPLIT 1
#if UIP_CONF_IPV6 #if UIP_CONF_IPV6
#define UIP_CONF_IP_FORWARD 0 #define UIP_CONF_IP_FORWARD 0
#define UIP_CONF_DS6_NBR_NBU 100 #define UIP_CONF_DS6_NBR_NBU 100
#define UIP_CONF_DS6_DEFRT_NBU 2 #define UIP_CONF_DS6_DEFRT_NBU 2
#define UIP_CONF_DS6_PREFIX_NBU 5 #define UIP_CONF_DS6_PREFIX_NBU 5
@ -74,16 +74,16 @@ typedef unsigned short uip_stats_t;
#include "ctk/ctk-console.h" #include "ctk/ctk-console.h"
#define CH_ULCORNER 0xDA #define CH_ULCORNER '+'
#define CH_URCORNER 0xBF #define CH_URCORNER '+'
#define CH_LLCORNER 0xC0 #define CH_LLCORNER '+'
#define CH_LRCORNER 0xD9 #define CH_LRCORNER '+'
#define CH_ENTER '\r' #define CH_ENTER '\r'
#define CH_DEL '\b' #define CH_DEL '\b'
#define CH_CURS_UP -1 #define CH_CURS_UP -1
#define CH_CURS_LEFT -2 #define CH_CURS_LEFT -2
#define CH_CURS_RIGHT -3 #define CH_CURS_RIGHT -3
#define CH_CURS_DOWN -4 #define CH_CURS_DOWN -4
#define CTK_CONF_MENU_KEY -5 /* F10 */ #define CTK_CONF_MENU_KEY -5 /* F10 */
#define CTK_CONF_WINDOWSWITCH_KEY -6 /* Ctrl-Tab */ #define CTK_CONF_WINDOWSWITCH_KEY -6 /* Ctrl-Tab */

View file

@ -112,8 +112,8 @@ console_init(void)
SetConsoleCtrlHandler(ctrlhandler, TRUE); SetConsoleCtrlHandler(ctrlhandler, TRUE);
atexit(console_exit); atexit(console_exit);
memset(blank, ' ', sizeof(blank)); memset(blank, ' ', sizeof(blank));
memset(hline, 0xC4, sizeof(hline)); memset(hline, '-', sizeof(hline));
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
void void
@ -159,8 +159,8 @@ static void
setcolor(void) setcolor(void)
{ {
SetConsoleTextAttribute(stdouthandle, (WORD)(reversed? (color & 0x0F) << 4 | SetConsoleTextAttribute(stdouthandle, (WORD)(reversed? (color & 0x0F) << 4 |
(color & 0xF0) >> 4 (color & 0xF0) >> 4
: color)); : color));
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
unsigned char unsigned char
@ -264,7 +264,7 @@ cvline(unsigned char length)
y = wherey(); y = wherey();
for(i = 0; i < length; ++i) { for(i = 0; i < length; ++i) {
cputcxy(x, (unsigned char)(y + i), (char)0xB3); cputcxy(x, (unsigned char)(y + i), '|');
} }
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
@ -338,25 +338,25 @@ console_readkey(KEY_EVENT_RECORD keyrecord)
if(key == 0) { if(key == 0) {
switch(keyrecord.wVirtualKeyCode) { switch(keyrecord.wVirtualKeyCode) {
case VK_TAB: case VK_TAB:
if(keyrecord.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) { if(keyrecord.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) {
key = CTK_CONF_WINDOWSWITCH_KEY; key = CTK_CONF_WINDOWSWITCH_KEY;
} }
break; break;
case VK_LEFT: case VK_LEFT:
key = CH_CURS_LEFT; key = CH_CURS_LEFT;
break; break;
case VK_UP: case VK_UP:
key = CH_CURS_UP; key = CH_CURS_UP;
break; break;
case VK_RIGHT: case VK_RIGHT:
key = CH_CURS_RIGHT; key = CH_CURS_RIGHT;
break; break;
case VK_DOWN: case VK_DOWN:
key = CH_CURS_DOWN; key = CH_CURS_DOWN;
break; break;
case VK_F10: case VK_F10:
key = CTK_CONF_MENU_KEY; key = CTK_CONF_MENU_KEY;
break; break;
} }
} }