Exemple #1
0
/*
 *  ws() is a shortened version of wr_string().
 */
void _cdecl ws(int col, int row, const char *in_string)
{
#if (DEVICE_CONSOLE_OUT)

  #if (USES_UART)
   int   was_unlocked;
  #endif

   if (!crt_is_init) return;

  #if (USES_UART)
   was_unlocked = !IS_LOCKED(self);
   LOCK(self);
   ANSI_GotoXY(row,col);
   ps(in_string);
   if (was_unlocked) unlockx(self);
  #endif

  #if defined(PEG) && SMXPEG_CONSOLE_WINDOW
   //TODO:
  #endif

#else
   /* Avoid compiler warning about unused pars. */
   (void) col;
   (void) row;
   (void) in_string;

#endif
}
Exemple #2
0
/*
 *  clr_screen() clears the operation screen to the background color
 *  passed to it and sets a foreground color. See xcrt.h for a list
 *  of colors.
 */
void _cdecl clr_screen(int F_color, int B_color)
{
#if (DEVICE_CONSOLE_OUT)

 #if (USES_UART)
   int   was_unlocked;
 #endif

   if (!crt_is_init) return;

 #if (USES_UART)
  #if (USE_COLOR == 0)
   F_color = WHITE;
   B_color = BLACK;
  #endif
   was_unlocked = !IS_LOCKED(self);
   LOCK(self);
   ANSI_GotoXY(0,0);
   ANSI_SetGMode(F_color+30);
   ANSI_SetGMode(B_color+40);
   ANSI_ClrScreen();
   if (was_unlocked) unlockx(self);
 #endif

 #if defined(PEG) && SMXPEG_CONSOLE_WINDOW
   //TODO:
 #endif

#else
   /* Avoid compiler warning about unused pars. */
   (void) F_color;
   (void) B_color;

#endif
}
Exemple #3
0
/*
 *  clr_line() can be used to clear a line (row) of the screen to a particular
 *  background color.  See xcrt.h for a list of background colors.
 */
void _cdecl clr_line(int row, int B_color)
{
#if (DEVICE_CONSOLE_OUT)

  #if (USES_UART)
   int   was_unlocked;
  #endif

   if (!crt_is_init) return;

  #if (USES_UART)
   was_unlocked = !IS_LOCKED(self);
   LOCK(self);
   /* goto beginning of line and clear to end */
   ANSI_GotoXY(row,0);
   ANSI_SetGMode(B_color+40);
   ANSI_ClrEndOfLine();
   if (was_unlocked) unlockx(self);
  #endif

  #if defined(PEG) && SMXPEG_CONSOLE_WINDOW
   //TODO:
  #endif

#else
   /* Avoid compiler warning about unused pars. */
   (void) row;
   (void) B_color;

#endif
}
Exemple #4
0
/* clr_screen_isr() clears the operation screen to the background color
*  passed to it and sets a foreground color. It can be called from isr's
*  and from go_smx() which runs before we're in the tasking environment
*  since it does not call any ssr's (e.g. unlockx()).
*/
void _cdecl clr_screen_isr(void)
{
#if (DEVICE_CONSOLE_OUT)

  #if (USES_UART)
   if (!crt_is_init) return;
   ANSI_GotoXY(0,0);
   ANSI_SetGMode(LIGHTGRAY+30);
   ANSI_SetGMode(BLACK+40);
   ANSI_ClrScreen();
  #endif

  #if defined(PEG) && SMXPEG_CONSOLE_WINDOW
   //TODO:
  #endif

#endif
}
Exemple #5
0
/*
 *  wr_string() writes a string to the operation screen at the location
 *  specified by col and row.  F_color is the color of the string
 *  and B_color is the color of the background. blinking should be BLINK
 *  if the string is to blink, and !BLINK if not. The last parameter is
 *  a pointer to the null-terminated string. wr_string goes to the next
 *  line if the current line is filled.
 *
 *  wr_string() was modified to support writing to graphics screen
 *  as well as text screen.  If graphics has not been initialized,
 *  writes messages to text screen.  Necessary in order to see any
 *  smx error messages that occur during initialization (these are
 *  usually insufficient resource errors -- for example, failure to
 *  create task due to lack of tcb's.
 */
void _cdecl wr_string(int col, int row, int F_color, int B_color,
                                         int blinking, const char *in_string)
{
#if (DEVICE_CONSOLE_OUT)

 #if (USES_UART)
   int   was_unlocked;
 #endif

   if (!crt_is_init) return;

 #if (USES_UART)
  #if (USE_COLOR == 0)
   F_color = WHITE;
   B_color = BLACK;
  #endif
   was_unlocked = !IS_LOCKED(self);
   LOCK(self);
   ANSI_GotoXY(row,col);
   ANSI_SetGMode(F_color+30);
   ANSI_SetGMode(B_color+40);
   if (blinking)
      ANSI_SetGMode(BLINK);
   ps(in_string);
   ANSI_ClrEndOfLine();
   if (was_unlocked) unlockx(self);
 #endif

 #if defined(PEG) && SMXPEG_CONSOLE_WINDOW
   //TODO:
 #endif

#else
   /* Avoid compiler warning about unused pars. */
   (void) col;
   (void) row;
   (void) F_color;
   (void) B_color;
   (void) blinking;
   (void) in_string;

#endif
}
Exemple #6
0
//------------------------------------------------------------------------------ 
//				===== Help =====
//------------------------------------------------------------------------------
void View_Help(void)
{
    ANSI_GotoXY(0,11);    
    ANSI_ClearScreen(FROM);
    
    ANSI_Normal();
      
    ANSI_GotoXY(5,12);    Uart_Print(UART1," [ HELP ] ");
    ANSI_GotoXY(5,14);    Uart_Print(UART1," ① 개발자 : 표윤석(ROLAB 19th)");
	ANSI_GotoXY(5,15);    Uart_Print(UART1," ② 소  속 : 광운대 로보트연구회");
    ANSI_GotoXY(5,16);    Uart_Print(UART1," ③ 버  전 : ANSI-MENU 1.0");
    ANSI_GotoXY(5,17);    Uart_Print(UART1," ④ 설  명 : ATmega128을 이용한 비쥬얼 메뉴구성");
    
    ANSI_Line(21);
    ANSI_GotoXY(0,22);
    Uart_Print(UART1,"|  이전(B)   다음(N)   처음(S)   도움말(H)   종료(Q)  |");    
    ANSI_Line(23); 
    ANSI_GotoXY(0,24);
    Uart_Print(UART1,"명령어 >");
    ANSI_Normal(); 
}   
Exemple #7
0
/*
 *  ws_isr() writes a string to the screen and can be called from isr's
 *  since it does not call any ssr's (e.g. unlockx()). Useful for displaying
 *  markers for debugging purposes.
 */
void _cdecl ws_isr(int col, int row, const char * in_string)
{
#if (DEVICE_CONSOLE_OUT)

  #if (USES_UART)
   if (!crt_is_init) return;

   ANSI_GotoXY(row,col);
   ps(in_string);
  #endif

  #if defined(PEG) && SMXPEG_CONSOLE_WINDOW
   /* Don't implement for PEG since called from isr. */
  #endif

#else
   /* Avoid compiler warning about unused pars. */
   (void) col;
   (void) row;
   (void) in_string;

#endif
}
Exemple #8
0
//------------------------------------------------------------------------------ 
//				===== 메인메뉴 =====
//------------------------------------------------------------------------------
void View_MainMenu(void)
{
 	ANSI_ClearScreen(ALL);					// 터미널 전체 클리어
    ANSI_Normal();
    ANSI_Line(1);
    ANSI_Line(2);
    ANSI_Line(3);
    ANSI_Line(4); 
    ANSI_Line(5);
    ANSI_Line(6);     
    ANSI_Line(7); 
    ANSI_Line(8);  
    
    ANSI_GotoXY(5,3);
    Uart_Print(UART1,"■■■■■■■■■■\n");
    ANSI_GotoXY(5,4);
    Uart_Print(UART1,"■                ■■■■■■■■■■\n");
    ANSI_GotoXY(5,5);
    Uart_Print(UART1,"■    광운대학교                    ■■■\n");
   	ANSI_GotoXY(5,6);
    Uart_Print(UART1,"■■■         로보트연구회(ROLAB)      ■\n");
    ANSI_GotoXY(5,7);
    Uart_Print(UART1,"──■■■                              ■\n");    
    ANSI_GotoXY(5,8);
    Uart_Print(UART1,"────■■■■■■■■■■■■■■■■■\n");
    
    ANSI_Line(9);
    ANSI_Line(10);
	
    ANSI_Reverse(1);
	ANSI_GotoXY(57,4);
    Uart_Print(UART1," KwangWoon University \r\n"); 
    ANSI_GotoXY(58,6);
    Uart_Print(UART1," Robotics Laboratory \r\n");     
	ANSI_GotoXY(67,8);
    Uart_Print(UART1," SINCE 1985 \r\n"); 
    ANSI_Reverse(0);
    
    ANSI_Normal();
            
    ANSI_GotoXY(41,12);
    Uart_Print(UART1,"◆◆◆  ◆◆◆  ◆        ◆    ◆◆◆");
    ANSI_GotoXY(41,13);
    Uart_Print(UART1,"◆  ◆  ◆  ◆  ◆      ◆  ◆  ◆  ◆");
    ANSI_GotoXY(41,14);
    Uart_Print(UART1,"◆◆◆  ◆  ◆  ◆      ◆◆◆  ◆◆  ");
    ANSI_GotoXY(41,15);
    Uart_Print(UART1,"◆◆    ◆  ◆  ◆      ◆  ◆  ◆  ◆");
    ANSI_GotoXY(41,16);
    Uart_Print(UART1,"◆  ◆  ◆◆◆  ◆◆◆  ◆  ◆  ◆◆◆");
    ANSI_GotoXY(41,18);
    Uart_Print(UART1,"                       로랩19기 표윤석");
    

    ANSI_GotoXY(6,12);
    Uart_Print(UART1, "========== M E N U ==========");
    ANSI_GotoXY(5,14);
    Uart_Print(UART1," 1. 프로그램       6. 프로그램 ");
    ANSI_GotoXY(5,15);
    Uart_Print(UART1," 2. 프로그램       7. 프로그램 "); 
    ANSI_GotoXY(5,16);
    Uart_Print(UART1," 3. 프로그램       8. 프로그램 ");
    ANSI_GotoXY(5,17);
    Uart_Print(UART1," 4. 프로그램       9. 프로그램 ");
    ANSI_GotoXY(5,18);
    Uart_Print(UART1," 5. 프로그램       0. 프로그램 ");

    ANSI_Line(21);
    ANSI_GotoXY(0,22);
    Uart_Print(UART1,"|  이전(B)   다음(N)   처음(S)   도움말(H)   종료(Q)  |");    
    ANSI_Line(23); 
    ANSI_GotoXY(0,24);
    Uart_Print(UART1,"명령어 >");
    ANSI_Normal();  

}
Exemple #9
0
//------------------------------------------------------------------------------ 
//				===== Sub Menu 01 =====
//------------------------------------------------------------------------------
void View_SubMenu01(void)
{
    ANSI_GotoXY(0,11);    
    ANSI_ClearScreen(FROM);
    
    ANSI_Normal();
    
    ANSI_GotoXY(41,12);
    Uart_Print(UART1,"◆◆◆  ◆◆◆  ◆        ◆    ◆◆◆");
    ANSI_GotoXY(41,13);
    Uart_Print(UART1,"◆  ◆  ◆  ◆  ◆      ◆  ◆  ◆  ◆");
    ANSI_GotoXY(41,14);
    Uart_Print(UART1,"◆◆◆  ◆  ◆  ◆      ◆◆◆  ◆◆  ");
    ANSI_GotoXY(41,15);
    Uart_Print(UART1,"◆◆    ◆  ◆  ◆      ◆  ◆  ◆  ◆");
    ANSI_GotoXY(41,16);
    Uart_Print(UART1,"◆  ◆  ◆◆◆  ◆◆◆  ◆  ◆  ◆◆◆");
    ANSI_GotoXY(41,18);
    Uart_Print(UART1,"                       로랩19기 표윤석");
    
    ANSI_GotoXY(5,12);
    Uart_Print(UART1," [ MAIN MENU ] ");
    ANSI_GotoXY(5,14);
    Uart_Print(UART1," 1. 프로그램 ");

    ANSI_Line(21);
    ANSI_GotoXY(0,22);
    Uart_Print(UART1,"|  이전(B)   다음(N)   처음(S)   도움말(H)   종료(Q)  |");    
    ANSI_Line(23); 
    ANSI_GotoXY(0,24);
    Uart_Print(UART1,"명령어 >");
    ANSI_Normal(); 
}