* [ECOS] Clear Screen @ 2005-04-14 15:24 Magnus Ottosson 2005-04-14 15:56 ` [ECOS] " Grant Edwards ` (3 more replies) 0 siblings, 4 replies; 13+ messages in thread From: Magnus Ottosson @ 2005-04-14 15:24 UTC (permalink / raw) To: ecos-discuss Hi! I wan't to know if it's possible to clear the screen or update a specific line with eCos? I have an application that writes data on the screen with printf() and I want to clear this data and write new. Is there a clear screen function or something like it? Magnus ----------------------------------- Contact information Email: it3otma@ituniv.se -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
* [ECOS] Re: Clear Screen 2005-04-14 15:24 [ECOS] Clear Screen Magnus Ottosson @ 2005-04-14 15:56 ` Grant Edwards 2005-04-15 8:40 ` Magnus Ottosson 2005-04-14 15:57 ` [ECOS] " Gary Thomas ` (2 subsequent siblings) 3 siblings, 1 reply; 13+ messages in thread From: Grant Edwards @ 2005-04-14 15:56 UTC (permalink / raw) To: ecos-discuss In gmane.os.ecos.general, you wrote: > I wan't to know if it's possible to clear the screen or update a > specific line with eCos? Depends on what screen you're using. > I have an application that writes data on the screen with > printf() and I want to clear this data and write new. Is there > a clear screen function or something like it? Assuming you're using an ANSI terminal, writing such functions is pretty simple: void clearScreen(void) { printf("\033[2J") } void clearToEOL(void) { printf("\033[K") } void moveCursor(int row, int col) { printf("\033[%d;%dH",row, col) } and so on. -- Grant Edwards grante Yow! Here I am in 53 at B.C. and all I want is a visi.com dill pickle!! -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ECOS] Re: Clear Screen 2005-04-14 15:56 ` [ECOS] " Grant Edwards @ 2005-04-15 8:40 ` Magnus Ottosson 2005-04-15 8:58 ` Magnus Ottosson 2005-04-15 14:41 ` Grant Edwards 0 siblings, 2 replies; 13+ messages in thread From: Magnus Ottosson @ 2005-04-15 8:40 UTC (permalink / raw) Cc: ecos-discuss [-- Attachment #1: Type: text/plain, Size: 1192 bytes --] I have compiled the application for i386 target. It shall run on a P4-M. See atachment for my Makefile. I have tried printf("\033[2J") I will try: void clearToEOL(void) { printf("\033[K") } void moveCursor(int row, int col) { printf("\033[%d;%dH",row, col) } To if they work. //Magnus. Grant Edwards wrote: >In gmane.os.ecos.general, you wrote: > > > >>I wan't to know if it's possible to clear the screen or update a >>specific line with eCos? >> >> > >Depends on what screen you're using. > > > >>I have an application that writes data on the screen with >>printf() and I want to clear this data and write new. Is there >>a clear screen function or something like it? >> >> > >Assuming you're using an ANSI terminal, writing such functions >is pretty simple: > >void clearScreen(void) > { > printf("\033[2J") > } > >void clearToEOL(void) > { > printf("\033[K") > } > >void moveCursor(int row, int col) > { > printf("\033[%d;%dH",row, col) > } > >and so on. > > > -- ----------------------------------- Contact information Phone: (+46) (0) 31 206700 Mobile: (+46) (0) 733-908060 Email: it3otma@ituniv.se [-- Attachment #2: Makefile --] [-- Type: text/plain, Size: 666 bytes --] INSTALL_DIR = /home/supersonic/i386library_install COMPILER_DIR = /opt/ecos/gnutools/i386-elf/bin BOOT_DIR = /boot/ EXE_SOURCE = sigSonarServer.c EXE_OUTPUT = sigSonarServer include $(INSTALL_DIR)/include/pkgconf/ecos.mak COMPILER = $(COMPILER_DIR)/i386-elf-gcc COMPILER_FLAGS = -I$(INSTALL_DIR)/include LINKER_FLAGS = -nostartfiles -L$(INSTALL_DIR)/lib -Ttarget.ld $(EXE_OUTPUT): obj.o $(COMPILER) $(LINKER_FLAGS) $(ECOS_GLOBAL_LDFLAGS) -o $@ obj.o -rm -f obj.o obj.o: $(EXE_SOURCE) $(COMPILER) -c -o obj.o $(COMPILER_FLAGS) $(ECOS_GLOBAL_CFLAGS) \ $(EXE_SOURCE) .PHONY: clean install clean: -rm -f $(EXE_OUTPUT) install: cp ./$(EXE_OUTPUT) $(BOOT_DIR) [-- Attachment #3: sigSonarServer.c --] [-- Type: text/x-csrc, Size: 4174 bytes --] /*///////////////////////////////////////////////////////////////////////////// Project: Sea Grid Module: Sonar Control Description: Author: Magnus Ottosson, it3otma@ituniv.se Co Authors: N/A Created: 2005-03-31 //////////////////////////////////////////////////////////////////////////////*/ #include <stdlib.h> #include <stdio.h> #include <cyg/hal/hal_io.h> #include <cyg/kernel/kapi.h> #include <cyg/io/devtab.h> #include "sigSonarControl/sigSonarControl.h" #define KEYBOARD 0x60 void drawRootMenu(positions* currentPositions); void drawPositionsMenu(positions* currentPositions); void drawRootMenu(positions* currentPositions){ printf("\033[K"); printf(" -------------------------------------- \n"); printf(" | ++ Sonar Server ++ |\n"); printf(" | ~~~~~~~~~~~~ |\n"); printf(" | (1) See positions |\n"); printf(" | (q) Quit |\n"); printf(" | |\n"); printf(" | Make a choice |\n"); printf(" | |\n"); printf(" -------------------------------------- \n"); unsigned int input = 0; while (1) { HAL_READ_UINT8(KEYBOARD, input); if (input == 130) { drawPositionsMenu(currentPositions); break; } else if (input == 129) { // QUIT; } } } void drawPositionsMenu(positions* currentPositions){ unsigned int input = 0; while (1) { HAL_READ_UINT8(KEYBOARD, input); printf("\033[K"); printf(" -------------------------------------- \n"); printf(" | ++ Sonar Server Current Positions ++ |\n"); printf(" | ~~~~~~~~~~~~ |\n"); printf(" | Lorry |\n"); printf(" | ---------------- |\n"); printf(" | Front X: %d |\n",currentPositions -> currentLorryPos.frontX); printf(" | Front Y: %d |\n",currentPositions -> currentLorryPos.frontY); printf(" | Rear X: %d |\n",currentPositions -> currentLorryPos.rearX); printf(" | Rear Y: %d |\n",currentPositions -> currentLorryPos.rearY); printf(" | Angle : %f |\n",currentPositions -> currentLorryPos.angle); printf(" | |\n"); printf(" | Barge |\n"); printf(" | ---------------- |\n"); printf(" | Front X: %d |\n",currentPositions -> currentBargePos.frontX); printf(" | Front Y: %d |\n",currentPositions -> currentBargePos.frontY); printf(" | Rear X: %d |\n",currentPositions -> currentBargePos.rearX); printf(" | Rear Y: %d |\n",currentPositions -> currentBargePos.rearY); printf(" | Angle : %f |\n",currentPositions -> currentBargePos.angle); printf(" | |\n"); printf(" | Press ESC to return to root menu |\n"); printf(" | |\n"); printf(" -------------------------------------- \n"); if (input == 129) { drawRootMenu(currentPositions); break; } } } int main(void) { // Create the positions struct // Allocate the memory for the position struct. currentPositions = (positions*) malloc(sizeof(positions)); // Initialize the values to -1 currentPositions -> currentBargePos.angle = 1.0; currentPositions -> currentBargePos.frontX = 1; currentPositions -> currentBargePos.frontY = 1; currentPositions -> currentBargePos.rearX = 1; currentPositions -> currentBargePos.rearY = 1; currentPositions -> currentLorryPos.angle = 1.0; currentPositions -> currentLorryPos.frontX = 1; currentPositions -> currentLorryPos.frontY = 1; currentPositions -> currentLorryPos.rearX = 1; currentPositions -> currentLorryPos.rearY = 1; // TODO: Thread drawRootMenu(currentPositions); // TODO: Thread // startbeacons(); // TODO: Thread // listenToRadioReceiver(currentPositions); return 0; } [-- Attachment #4: Type: text/plain, Size: 148 bytes --] -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ECOS] Re: Clear Screen 2005-04-15 8:40 ` Magnus Ottosson @ 2005-04-15 8:58 ` Magnus Ottosson 2005-04-15 14:21 ` Frank Pagliughi ` (2 more replies) 2005-04-15 14:41 ` Grant Edwards 1 sibling, 3 replies; 13+ messages in thread From: Magnus Ottosson @ 2005-04-15 8:58 UTC (permalink / raw) Cc: ecos-discuss Neither of these options work. I guess that when I built eCos I did not build it with a terminal that support ansi? How would I do this? Magnus Magnus Ottosson wrote: >I have compiled the application for i386 target. It shall run on a P4-M. >See atachment for my Makefile. > >I have tried printf("\033[2J") > >I will try: > >void clearToEOL(void) > { > printf("\033[K") > } > >void moveCursor(int row, int col) > { > printf("\033[%d;%dH",row, col) > } > >To if they work. > >//Magnus. > > > >Grant Edwards wrote: > > > >>In gmane.os.ecos.general, you wrote: >> >> >> >> >> >>>I wan't to know if it's possible to clear the screen or update a >>>specific line with eCos? >>> >>> >>> >>> >>Depends on what screen you're using. >> >> >> >> >> >>>I have an application that writes data on the screen with >>>printf() and I want to clear this data and write new. Is there >>>a clear screen function or something like it? >>> >>> >>> >>> >>Assuming you're using an ANSI terminal, writing such functions >>is pretty simple: >> >>void clearScreen(void) >> { >> printf("\033[2J") >> } >> >>void clearToEOL(void) >> { >> printf("\033[K") >> } >> >>void moveCursor(int row, int col) >> { >> printf("\033[%d;%dH",row, col) >> } >> >>and so on. >> >> >> >> >> > > > >------------------------------------------------------------------------ > >INSTALL_DIR = /home/supersonic/i386library_install >COMPILER_DIR = /opt/ecos/gnutools/i386-elf/bin >BOOT_DIR = /boot/ >EXE_SOURCE = sigSonarServer.c >EXE_OUTPUT = sigSonarServer > >include $(INSTALL_DIR)/include/pkgconf/ecos.mak > >COMPILER = $(COMPILER_DIR)/i386-elf-gcc >COMPILER_FLAGS = -I$(INSTALL_DIR)/include >LINKER_FLAGS = -nostartfiles -L$(INSTALL_DIR)/lib -Ttarget.ld > >$(EXE_OUTPUT): obj.o > $(COMPILER) $(LINKER_FLAGS) $(ECOS_GLOBAL_LDFLAGS) -o $@ obj.o > -rm -f obj.o >obj.o: $(EXE_SOURCE) > $(COMPILER) -c -o obj.o $(COMPILER_FLAGS) $(ECOS_GLOBAL_CFLAGS) \ > $(EXE_SOURCE) > >.PHONY: clean install >clean: > -rm -f $(EXE_OUTPUT) >install: > cp ./$(EXE_OUTPUT) $(BOOT_DIR) > >------------------------------------------------------------------------ > >/*///////////////////////////////////////////////////////////////////////////// > > Project: Sea Grid > > Module: Sonar Control > > Description: > > Author: Magnus Ottosson, it3otma@ituniv.se > > Co Authors: N/A > > Created: 2005-03-31 > >//////////////////////////////////////////////////////////////////////////////*/ > >#include <stdlib.h> >#include <stdio.h> >#include <cyg/hal/hal_io.h> >#include <cyg/kernel/kapi.h> >#include <cyg/io/devtab.h> >#include "sigSonarControl/sigSonarControl.h" > >#define KEYBOARD 0x60 > >void drawRootMenu(positions* currentPositions); >void drawPositionsMenu(positions* currentPositions); > >void drawRootMenu(positions* currentPositions){ > > printf("\033[K"); > printf(" -------------------------------------- \n"); > printf(" | ++ Sonar Server ++ |\n"); > printf(" | ~~~~~~~~~~~~ |\n"); > printf(" | (1) See positions |\n"); > printf(" | (q) Quit |\n"); > printf(" | |\n"); > printf(" | Make a choice |\n"); > printf(" | |\n"); > printf(" -------------------------------------- \n"); > > unsigned int input = 0; > > while (1) { > > HAL_READ_UINT8(KEYBOARD, input); > > if (input == 130) { > drawPositionsMenu(currentPositions); > break; > } else if (input == 129) { > // QUIT; > } > } >} > >void drawPositionsMenu(positions* currentPositions){ > > unsigned int input = 0; > > while (1) { > > HAL_READ_UINT8(KEYBOARD, input); > > printf("\033[K"); > printf(" -------------------------------------- \n"); > printf(" | ++ Sonar Server Current Positions ++ |\n"); > printf(" | ~~~~~~~~~~~~ |\n"); > printf(" | Lorry |\n"); > printf(" | ---------------- |\n"); > printf(" | Front X: %d |\n",currentPositions -> currentLorryPos.frontX); > printf(" | Front Y: %d |\n",currentPositions -> currentLorryPos.frontY); > printf(" | Rear X: %d |\n",currentPositions -> currentLorryPos.rearX); > printf(" | Rear Y: %d |\n",currentPositions -> currentLorryPos.rearY); > printf(" | Angle : %f |\n",currentPositions -> currentLorryPos.angle); > printf(" | |\n"); > printf(" | Barge |\n"); > printf(" | ---------------- |\n"); > printf(" | Front X: %d |\n",currentPositions -> currentBargePos.frontX); > printf(" | Front Y: %d |\n",currentPositions -> currentBargePos.frontY); > printf(" | Rear X: %d |\n",currentPositions -> currentBargePos.rearX); > printf(" | Rear Y: %d |\n",currentPositions -> currentBargePos.rearY); > printf(" | Angle : %f |\n",currentPositions -> currentBargePos.angle); > printf(" | |\n"); > printf(" | Press ESC to return to root menu |\n"); > printf(" | |\n"); > printf(" -------------------------------------- \n"); > > if (input == 129) { > drawRootMenu(currentPositions); > break; > } > } >} > > >int main(void) { > > // Create the positions struct > // Allocate the memory for the position struct. > currentPositions = (positions*) malloc(sizeof(positions)); > // Initialize the values to -1 > currentPositions -> currentBargePos.angle = 1.0; > currentPositions -> currentBargePos.frontX = 1; > currentPositions -> currentBargePos.frontY = 1; > currentPositions -> currentBargePos.rearX = 1; > currentPositions -> currentBargePos.rearY = 1; > > currentPositions -> currentLorryPos.angle = 1.0; > currentPositions -> currentLorryPos.frontX = 1; > currentPositions -> currentLorryPos.frontY = 1; > currentPositions -> currentLorryPos.rearX = 1; > currentPositions -> currentLorryPos.rearY = 1; > > // TODO: Thread > drawRootMenu(currentPositions); > > // TODO: Thread > // startbeacons(); > > // TODO: Thread > // listenToRadioReceiver(currentPositions); > > > return 0; >} > > > > -- ----------------------------------- Contact information Phone: (+46) (0) 31 206700 Mobile: (+46) (0) 733-908060 Email: it3otma@ituniv.se -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [ECOS] Re: Clear Screen 2005-04-15 8:58 ` Magnus Ottosson @ 2005-04-15 14:21 ` Frank Pagliughi 2005-04-15 14:40 ` Frank Pagliughi 2005-04-16 11:32 ` Grant Edwards 2 siblings, 0 replies; 13+ messages in thread From: Frank Pagliughi @ 2005-04-15 14:21 UTC (permalink / raw) To: Magnus Ottosson; +Cc: ecos-discuss i386 Target, huh? Are you sending the output to a serial port or to a VGA screen? If a serial port, then it's the terminal emulator program on the host that needs to ANSI support, not your application. If you're using a VGA screen, you can always write directly to the video memory. In text mode, it starts at 0xB8000. Search the web for more info, or look for an old book on DOS. I don't know how eCos positions the cursor on a VGA screen, though. So printf() positions won't automatically be restarted at the top left after clearing. Here's an example for a standard VGA in standard 80x25 text mode: // -------------------------------------- // conio_test.c // // Test of the PC console I/O functions. // These are fast direct-to-video-memory routines. #include <stdio.h> typedef unsigned char byte; #define SCR_WD 80 #define SCR_HT 25 typedef struct tag_chel { char ch; // Char displayed byte attr; // FG & BG colors } chel; typedef chel chel_line[80]; chel_line *pc_scr = ((chel_line*) 0xB8000); static byte scrattr = 0x07; // White FG on black BG // -------------------------------------- void clrscr(void) { int x, y; for (y=0; y<SCR_HT; y++) { for (x=0; x<SCR_WD; x++) { pc_scr[y][x].ch = ' '; pc_scr[y][x].attr = scrattr; } } } // ------------------------------------ int main (int argc, char *argv[]) { clrscr(); pc_scr[0][0].ch = 'A'; pc_scr[0][1].ch = '*'; return(0); } -----Original Message----- From: ecos-discuss-owner@ecos.sourceware.org [mailto:ecos-discuss-owner@ecos.sourceware.org]On Behalf Of Magnus Ottosson Sent: Friday, April 15, 2005 4:40 AM Cc: ecos-discuss@ecos.sourceware.org Subject: Re: [ECOS] Re: Clear Screen Neither of these options work. I guess that when I built eCos I did not build it with a terminal that support ansi? How would I do this? Magnus Magnus Ottosson wrote: >I have compiled the application for i386 target. It shall run on a P4-M. >See atachment for my Makefile. > >I have tried printf("\033[2J") > >I will try: > >void clearToEOL(void) > { > printf("\033[K") > } > >void moveCursor(int row, int col) > { > printf("\033[%d;%dH",row, col) > } > >To if they work. > >//Magnus. > > > >Grant Edwards wrote: > > > >>In gmane.os.ecos.general, you wrote: >> >> >> >> >> >>>I wan't to know if it's possible to clear the screen or update a >>>specific line with eCos? >>> >>> >>> >>> >>Depends on what screen you're using. >> >> >> >> >> >>>I have an application that writes data on the screen with >>>printf() and I want to clear this data and write new. Is there >>>a clear screen function or something like it? >>> >>> >>> >>> >>Assuming you're using an ANSI terminal, writing such functions >>is pretty simple: >> >>void clearScreen(void) >> { >> printf("\033[2J") >> } >> >>void clearToEOL(void) >> { >> printf("\033[K") >> } >> >>void moveCursor(int row, int col) >> { >> printf("\033[%d;%dH",row, col) >> } >> >>and so on. >> >> >> >> >> > > > >------------------------------------------------------------------------ > >INSTALL_DIR = /home/supersonic/i386library_install >COMPILER_DIR = /opt/ecos/gnutools/i386-elf/bin >BOOT_DIR = /boot/ >EXE_SOURCE = sigSonarServer.c >EXE_OUTPUT = sigSonarServer > >include $(INSTALL_DIR)/include/pkgconf/ecos.mak > >COMPILER = $(COMPILER_DIR)/i386-elf-gcc >COMPILER_FLAGS = -I$(INSTALL_DIR)/include >LINKER_FLAGS = -nostartfiles -L$(INSTALL_DIR)/lib -Ttarget.ld > >$(EXE_OUTPUT): obj.o > $(COMPILER) $(LINKER_FLAGS) $(ECOS_GLOBAL_LDFLAGS) -o $@ obj.o > -rm -f obj.o >obj.o: $(EXE_SOURCE) > $(COMPILER) -c -o obj.o $(COMPILER_FLAGS) $(ECOS_GLOBAL_CFLAGS) \ > $(EXE_SOURCE) > >.PHONY: clean install >clean: > -rm -f $(EXE_OUTPUT) >install: > cp ./$(EXE_OUTPUT) $(BOOT_DIR) > >------------------------------------------------------------------------ > >/*///////////////////////////////////////////////////////////////////////// //// > > Project: Sea Grid > > Module: Sonar Control > > Description: > > Author: Magnus Ottosson, it3otma@ituniv.se > > Co Authors: N/A > > Created: 2005-03-31 > >/////////////////////////////////////////////////////////////////////////// ///*/ > >#include <stdlib.h> >#include <stdio.h> >#include <cyg/hal/hal_io.h> >#include <cyg/kernel/kapi.h> >#include <cyg/io/devtab.h> >#include "sigSonarControl/sigSonarControl.h" > >#define KEYBOARD 0x60 > >void drawRootMenu(positions* currentPositions); >void drawPositionsMenu(positions* currentPositions); > >void drawRootMenu(positions* currentPositions){ > > printf("\033[K"); > printf(" -------------------------------------- \n"); > printf(" | ++ Sonar Server ++ |\n"); > printf(" | ~~~~~~~~~~~~ |\n"); > printf(" | (1) See positions |\n"); > printf(" | (q) Quit |\n"); > printf(" | |\n"); > printf(" | Make a choice |\n"); > printf(" | |\n"); > printf(" -------------------------------------- \n"); > > unsigned int input = 0; > > while (1) { > > HAL_READ_UINT8(KEYBOARD, input); > > if (input == 130) { > drawPositionsMenu(currentPositions); > break; > } else if (input == 129) { > // QUIT; > } > } >} > >void drawPositionsMenu(positions* currentPositions){ > > unsigned int input = 0; > > while (1) { > > HAL_READ_UINT8(KEYBOARD, input); > > printf("\033[K"); > printf(" -------------------------------------- \n"); > printf(" | ++ Sonar Server Current Positions ++ |\n"); > printf(" | ~~~~~~~~~~~~ |\n"); > printf(" | Lorry |\n"); > printf(" | ---------------- |\n"); > printf(" | Front X: %d |\n",currentPositions -> currentLorryPos.frontX); > printf(" | Front Y: %d |\n",currentPositions -> currentLorryPos.frontY); > printf(" | Rear X: %d |\n",currentPositions -> currentLorryPos.rearX); > printf(" | Rear Y: %d |\n",currentPositions -> currentLorryPos.rearY); > printf(" | Angle : %f |\n",currentPositions -> currentLorryPos.angle); > printf(" | |\n"); > printf(" | Barge |\n"); > printf(" | ---------------- |\n"); > printf(" | Front X: %d |\n",currentPositions -> currentBargePos.frontX); > printf(" | Front Y: %d |\n",currentPositions -> currentBargePos.frontY); > printf(" | Rear X: %d |\n",currentPositions -> currentBargePos.rearX); > printf(" | Rear Y: %d |\n",currentPositions -> currentBargePos.rearY); > printf(" | Angle : %f |\n",currentPositions -> currentBargePos.angle); > printf(" | |\n"); > printf(" | Press ESC to return to root menu |\n"); > printf(" | |\n"); > printf(" -------------------------------------- \n"); > > if (input == 129) { > drawRootMenu(currentPositions); > break; > } > } >} > > >int main(void) { > > // Create the positions struct > // Allocate the memory for the position struct. > currentPositions = (positions*) malloc(sizeof(positions)); > // Initialize the values to -1 > currentPositions -> currentBargePos.angle = 1.0; > currentPositions -> currentBargePos.frontX = 1; > currentPositions -> currentBargePos.frontY = 1; > currentPositions -> currentBargePos.rearX = 1; > currentPositions -> currentBargePos.rearY = 1; > > currentPositions -> currentLorryPos.angle = 1.0; > currentPositions -> currentLorryPos.frontX = 1; > currentPositions -> currentLorryPos.frontY = 1; > currentPositions -> currentLorryPos.rearX = 1; > currentPositions -> currentLorryPos.rearY = 1; > > // TODO: Thread > drawRootMenu(currentPositions); > > // TODO: Thread > // startbeacons(); > > // TODO: Thread > // listenToRadioReceiver(currentPositions); > > > return 0; >} > > > > -- ----------------------------------- Contact information Phone: (+46) (0) 31 206700 Mobile: (+46) (0) 733-908060 Email: it3otma@ituniv.se -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [ECOS] Re: Clear Screen 2005-04-15 8:58 ` Magnus Ottosson 2005-04-15 14:21 ` Frank Pagliughi @ 2005-04-15 14:40 ` Frank Pagliughi 2005-04-16 11:32 ` Grant Edwards 2 siblings, 0 replies; 13+ messages in thread From: Frank Pagliughi @ 2005-04-15 14:40 UTC (permalink / raw) To: Magnus Ottosson; +Cc: ecos-discuss Oh, one more thing... A serial terminal emulator may also clear it's display if you send it a Form Feed character: putchar('\f'); Frank -----Original Message----- From: ecos-discuss-owner@ecos.sourceware.org [mailto:ecos-discuss-owner@ecos.sourceware.org]On Behalf Of Magnus Ottosson Sent: Friday, April 15, 2005 4:40 AM Cc: ecos-discuss@ecos.sourceware.org Subject: Re: [ECOS] Re: Clear Screen Neither of these options work. I guess that when I built eCos I did not build it with a terminal that support ansi? How would I do this? Magnus Magnus Ottosson wrote: >I have compiled the application for i386 target. It shall run on a P4-M. >See atachment for my Makefile. > >I have tried printf("\033[2J") > >I will try: > >void clearToEOL(void) > { > printf("\033[K") > } > >void moveCursor(int row, int col) > { > printf("\033[%d;%dH",row, col) > } > >To if they work. > >//Magnus. > > > >Grant Edwards wrote: > > > >>In gmane.os.ecos.general, you wrote: >> >> >> >> >> >>>I wan't to know if it's possible to clear the screen or update a >>>specific line with eCos? >>> >>> >>> >>> >>Depends on what screen you're using. >> >> >> >> >> >>>I have an application that writes data on the screen with >>>printf() and I want to clear this data and write new. Is there >>>a clear screen function or something like it? >>> >>> >>> >>> >>Assuming you're using an ANSI terminal, writing such functions >>is pretty simple: >> >>void clearScreen(void) >> { >> printf("\033[2J") >> } >> >>void clearToEOL(void) >> { >> printf("\033[K") >> } >> >>void moveCursor(int row, int col) >> { >> printf("\033[%d;%dH",row, col) >> } >> >>and so on. >> >> >> >> >> > > > >------------------------------------------------------------------------ > >INSTALL_DIR = /home/supersonic/i386library_install >COMPILER_DIR = /opt/ecos/gnutools/i386-elf/bin >BOOT_DIR = /boot/ >EXE_SOURCE = sigSonarServer.c >EXE_OUTPUT = sigSonarServer > >include $(INSTALL_DIR)/include/pkgconf/ecos.mak > >COMPILER = $(COMPILER_DIR)/i386-elf-gcc >COMPILER_FLAGS = -I$(INSTALL_DIR)/include >LINKER_FLAGS = -nostartfiles -L$(INSTALL_DIR)/lib -Ttarget.ld > >$(EXE_OUTPUT): obj.o > $(COMPILER) $(LINKER_FLAGS) $(ECOS_GLOBAL_LDFLAGS) -o $@ obj.o > -rm -f obj.o >obj.o: $(EXE_SOURCE) > $(COMPILER) -c -o obj.o $(COMPILER_FLAGS) $(ECOS_GLOBAL_CFLAGS) \ > $(EXE_SOURCE) > >.PHONY: clean install >clean: > -rm -f $(EXE_OUTPUT) >install: > cp ./$(EXE_OUTPUT) $(BOOT_DIR) > >------------------------------------------------------------------------ > >/*///////////////////////////////////////////////////////////////////////// //// > > Project: Sea Grid > > Module: Sonar Control > > Description: > > Author: Magnus Ottosson, it3otma@ituniv.se > > Co Authors: N/A > > Created: 2005-03-31 > >/////////////////////////////////////////////////////////////////////////// ///*/ > >#include <stdlib.h> >#include <stdio.h> >#include <cyg/hal/hal_io.h> >#include <cyg/kernel/kapi.h> >#include <cyg/io/devtab.h> >#include "sigSonarControl/sigSonarControl.h" > >#define KEYBOARD 0x60 > >void drawRootMenu(positions* currentPositions); >void drawPositionsMenu(positions* currentPositions); > >void drawRootMenu(positions* currentPositions){ > > printf("\033[K"); > printf(" -------------------------------------- \n"); > printf(" | ++ Sonar Server ++ |\n"); > printf(" | ~~~~~~~~~~~~ |\n"); > printf(" | (1) See positions |\n"); > printf(" | (q) Quit |\n"); > printf(" | |\n"); > printf(" | Make a choice |\n"); > printf(" | |\n"); > printf(" -------------------------------------- \n"); > > unsigned int input = 0; > > while (1) { > > HAL_READ_UINT8(KEYBOARD, input); > > if (input == 130) { > drawPositionsMenu(currentPositions); > break; > } else if (input == 129) { > // QUIT; > } > } >} > >void drawPositionsMenu(positions* currentPositions){ > > unsigned int input = 0; > > while (1) { > > HAL_READ_UINT8(KEYBOARD, input); > > printf("\033[K"); > printf(" -------------------------------------- \n"); > printf(" | ++ Sonar Server Current Positions ++ |\n"); > printf(" | ~~~~~~~~~~~~ |\n"); > printf(" | Lorry |\n"); > printf(" | ---------------- |\n"); > printf(" | Front X: %d |\n",currentPositions -> currentLorryPos.frontX); > printf(" | Front Y: %d |\n",currentPositions -> currentLorryPos.frontY); > printf(" | Rear X: %d |\n",currentPositions -> currentLorryPos.rearX); > printf(" | Rear Y: %d |\n",currentPositions -> currentLorryPos.rearY); > printf(" | Angle : %f |\n",currentPositions -> currentLorryPos.angle); > printf(" | |\n"); > printf(" | Barge |\n"); > printf(" | ---------------- |\n"); > printf(" | Front X: %d |\n",currentPositions -> currentBargePos.frontX); > printf(" | Front Y: %d |\n",currentPositions -> currentBargePos.frontY); > printf(" | Rear X: %d |\n",currentPositions -> currentBargePos.rearX); > printf(" | Rear Y: %d |\n",currentPositions -> currentBargePos.rearY); > printf(" | Angle : %f |\n",currentPositions -> currentBargePos.angle); > printf(" | |\n"); > printf(" | Press ESC to return to root menu |\n"); > printf(" | |\n"); > printf(" -------------------------------------- \n"); > > if (input == 129) { > drawRootMenu(currentPositions); > break; > } > } >} > > >int main(void) { > > // Create the positions struct > // Allocate the memory for the position struct. > currentPositions = (positions*) malloc(sizeof(positions)); > // Initialize the values to -1 > currentPositions -> currentBargePos.angle = 1.0; > currentPositions -> currentBargePos.frontX = 1; > currentPositions -> currentBargePos.frontY = 1; > currentPositions -> currentBargePos.rearX = 1; > currentPositions -> currentBargePos.rearY = 1; > > currentPositions -> currentLorryPos.angle = 1.0; > currentPositions -> currentLorryPos.frontX = 1; > currentPositions -> currentLorryPos.frontY = 1; > currentPositions -> currentLorryPos.rearX = 1; > currentPositions -> currentLorryPos.rearY = 1; > > // TODO: Thread > drawRootMenu(currentPositions); > > // TODO: Thread > // startbeacons(); > > // TODO: Thread > // listenToRadioReceiver(currentPositions); > > > return 0; >} > > > > -- ----------------------------------- Contact information Phone: (+46) (0) 31 206700 Mobile: (+46) (0) 733-908060 Email: it3otma@ituniv.se -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
* [ECOS] Re: Clear Screen 2005-04-15 8:58 ` Magnus Ottosson 2005-04-15 14:21 ` Frank Pagliughi 2005-04-15 14:40 ` Frank Pagliughi @ 2005-04-16 11:32 ` Grant Edwards 2 siblings, 0 replies; 13+ messages in thread From: Grant Edwards @ 2005-04-16 11:32 UTC (permalink / raw) To: ecos-discuss In gmane.os.ecos.general, you wrote: > Neither of these options work. I guess that when I built eCos I did not > build it with a terminal that support ansi? You don't need to build it with a terminal that supports ANSI. You connect an ANSI terminal to it when you run it. -- Grant Edwards grante Yow! I want to read my new at poem about pork brains and visi.com outer space... -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
* [ECOS] Re: Clear Screen 2005-04-15 8:40 ` Magnus Ottosson 2005-04-15 8:58 ` Magnus Ottosson @ 2005-04-15 14:41 ` Grant Edwards 1 sibling, 0 replies; 13+ messages in thread From: Grant Edwards @ 2005-04-15 14:41 UTC (permalink / raw) To: ecos-discuss In gmane.os.ecos.general, you wrote: > I have compiled the application for i386 target. It shall run on a P4-M. Ah, but we didn't ask what kind of CPU. We asked what kind of screen. Is it an ANSI terminal or not? The functions I posted were for ANSI terminals. -- Grant Edwards grante Yow! I'm EMOTIONAL at now because I have visi.com MERCHANDISING CLOUT!! -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ECOS] Clear Screen 2005-04-14 15:24 [ECOS] Clear Screen Magnus Ottosson 2005-04-14 15:56 ` [ECOS] " Grant Edwards @ 2005-04-14 15:57 ` Gary Thomas 2005-04-14 16:03 ` [ECOS] Insight gdb Preferences under Linux Hoat Frank Pagliughi 2005-04-14 19:46 ` [ECOS] Clear Screen Nick Garnett 3 siblings, 0 replies; 13+ messages in thread From: Gary Thomas @ 2005-04-14 15:57 UTC (permalink / raw) To: Magnus Ottosson; +Cc: eCos Discussion On Thu, 2005-04-14 at 17:24 +0200, Magnus Ottosson wrote: > Hi! > > I wan't to know if it's possible to clear the screen or update a > specific line with eCos? > > I have an application that writes data on the screen with printf() and I > want to clear this data and write new. Is there a clear screen function > or something like it? What screen? What [target] platform? -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
* [ECOS] Insight gdb Preferences under Linux Hoat 2005-04-14 15:24 [ECOS] Clear Screen Magnus Ottosson 2005-04-14 15:56 ` [ECOS] " Grant Edwards 2005-04-14 15:57 ` [ECOS] " Gary Thomas @ 2005-04-14 16:03 ` Frank Pagliughi 2005-04-14 16:16 ` dirk husemann 2005-04-14 19:46 ` [ECOS] Clear Screen Nick Garnett 3 siblings, 1 reply; 13+ messages in thread From: Frank Pagliughi @ 2005-04-14 16:03 UTC (permalink / raw) To: ecos-discuss Where does Insight store it's preferences on a Linux host? I recently upgraded my Linux host to FC3, and now I have to reset all my global, source, and target preferences each time I run it. I'm assuming I no longer have write access to a directory. I'm using the binary distribution of i386-elf-gdb from eCos 2.0. Thanks, Frank Pagliughi -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ECOS] Insight gdb Preferences under Linux Hoat 2005-04-14 16:03 ` [ECOS] Insight gdb Preferences under Linux Hoat Frank Pagliughi @ 2005-04-14 16:16 ` dirk husemann 2005-04-14 16:18 ` dirk husemann 0 siblings, 1 reply; 13+ messages in thread From: dirk husemann @ 2005-04-14 16:16 UTC (permalink / raw) To: ecos-discuss; +Cc: Frank Pagliughi, ecos-discuss [-- Attachment #1: Type: text/plain, Size: 1070 bytes --] On Thursday, 14. April 2005 18:03, Frank Pagliughi wrote: > Where does Insight store it's preferences on a Linux host? I recently > upgraded my Linux host to FC3, and now I have to reset all my global, > source, and target preferences each time I run it. I'm assuming I no longer > have write access to a directory. > > I'm using the binary distribution of i386-elf-gdb from eCos 2.0. .gdbtkinit ? don't know for sure, just assumed that that was where insight stores its stuff. cheers, dirk -- Dr Dirk Husemann, Pervasive Computing, IBM Research, Zurich Research Lab hud@zurich.ibm.com --- http://www.zurich.ibm.com/~hud/ PGP key: http://www.zurich.ibm.com/~hud/contact/PGP PGP Fingerprint: 983C 48E7 0A78 A313 401C C4AD 3C0A 278E 6431 A149 Email only authentic if signed with PGP key. Appended to this email is an electronic signature attachment. You can ignore it if your email program does not know how to verify such a signature. If you'd like to learn more about this topic, www.gnupg.org is a good starting point. [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ECOS] Insight gdb Preferences under Linux Hoat 2005-04-14 16:16 ` dirk husemann @ 2005-04-14 16:18 ` dirk husemann 0 siblings, 0 replies; 13+ messages in thread From: dirk husemann @ 2005-04-14 16:18 UTC (permalink / raw) To: ecos-discuss; +Cc: Frank Pagliughi, ecos-discuss [-- Attachment #1: Type: text/plain, Size: 1070 bytes --] On Thursday, 14. April 2005 18:03, Frank Pagliughi wrote: > Where does Insight store it's preferences on a Linux host? I recently > upgraded my Linux host to FC3, and now I have to reset all my global, > source, and target preferences each time I run it. I'm assuming I no longer > have write access to a directory. > > I'm using the binary distribution of i386-elf-gdb from eCos 2.0. .gdbtkinit ? don't know for sure, just assumed that that was where insight stores its stuff. cheers, dirk -- Dr Dirk Husemann, Pervasive Computing, IBM Research, Zurich Research Lab hud@zurich.ibm.com --- http://www.zurich.ibm.com/~hud/ PGP key: http://www.zurich.ibm.com/~hud/contact/PGP PGP Fingerprint: 983C 48E7 0A78 A313 401C C4AD 3C0A 278E 6431 A149 Email only authentic if signed with PGP key. Appended to this email is an electronic signature attachment. You can ignore it if your email program does not know how to verify such a signature. If you'd like to learn more about this topic, www.gnupg.org is a good starting point. [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ECOS] Clear Screen 2005-04-14 15:24 [ECOS] Clear Screen Magnus Ottosson ` (2 preceding siblings ...) 2005-04-14 16:03 ` [ECOS] Insight gdb Preferences under Linux Hoat Frank Pagliughi @ 2005-04-14 19:46 ` Nick Garnett 3 siblings, 0 replies; 13+ messages in thread From: Nick Garnett @ 2005-04-14 19:46 UTC (permalink / raw) To: Magnus Ottosson; +Cc: ecos-discuss Magnus Ottosson <it3otma@ituniv.se> writes: > Hi! > > I wan't to know if it's possible to clear the screen or update a > specific line with eCos? > > I have an application that writes data on the screen with printf() and I > want to clear this data and write new. Is there a clear screen function > or something like it? If you are working on a PC with the standard HAL screen support, then sending a Ctrl-L should do the trick. If you are using either HyperTerm or minicom over a serial line, then the escape sequences that Grant has supplied should work. Finally you could just output 25 linefeeds, which will work whatever output channel you are using. -- Nick Garnett eCos Kernel Architect http://www.ecoscentric.com The eCos and RedBoot experts -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2005-04-15 14:41 UTC | newest] Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-04-14 15:24 [ECOS] Clear Screen Magnus Ottosson 2005-04-14 15:56 ` [ECOS] " Grant Edwards 2005-04-15 8:40 ` Magnus Ottosson 2005-04-15 8:58 ` Magnus Ottosson 2005-04-15 14:21 ` Frank Pagliughi 2005-04-15 14:40 ` Frank Pagliughi 2005-04-16 11:32 ` Grant Edwards 2005-04-15 14:41 ` Grant Edwards 2005-04-14 15:57 ` [ECOS] " Gary Thomas 2005-04-14 16:03 ` [ECOS] Insight gdb Preferences under Linux Hoat Frank Pagliughi 2005-04-14 16:16 ` dirk husemann 2005-04-14 16:18 ` dirk husemann 2005-04-14 19:46 ` [ECOS] Clear Screen Nick Garnett
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).