![]() |
BLDC control on ATAVRMC303 with ATxMega128A1
|
,v More...
#include "config.h"#include "ushell_task.h"#include "ascii.h"#include "lib_mcu/uart/uart_lib.h"#include "mc_interface.h"
Go to the source code of this file.
Functions | |
| void | build_cmd (void) |
| get the full command line to be interpreted. More... | |
| void | convert_param1 (void) |
| convert param1 to binaire. More... | |
| void | convert_param2 (void) |
| convert param2 to binaire. More... | |
| U16 | debug_get_value1 (void) |
| U16 | debug_get_value2 (void) |
| U8 | mystrncmp (U8 *str1, U8 code *str2, U8 i) |
| compares two strings located in flash code area. More... | |
| void | parse_cmd (void) |
| decodes full command line into command type and arguments More... | |
| void | print_hex16 (U16 value) |
| Display an U16 with hexa form. More... | |
| void | print_msg (U8 code *str) |
| Display an ASCII code string. More... | |
| void | ushell_task (void) |
| Entry point of the explorer task management. More... | |
| void | ushell_task_init (void) |
| This function initializes the hardware/software ressources required for ushell task. More... | |
Variables | |
| static U8 | cmd |
| static U8 | cmd_str [26] |
| static U8 | cmd_type |
| static U8 | i_str =0 |
| U8 code | msg_er_cmd_not_found [] =MSG_ER_CMD_NOT_FOUND |
| U8 code | msg_help [] =MSG_HELP |
| U8 code | msg_prompt [] =MSG_PROMPT |
| U8 code | msg_welcome [] =MSG_WELCOME |
| static U16 | par_str1 [8] |
| static U16 | par_str2 [8] |
| static U16 | param1 |
| static U16 | param2 |
| S16 | speed_error |
| Error calculation. More... | |
| U8 code | str_backward [] =STR_BACKWARD |
| U8 code | str_forward [] =STR_FORWARD |
| U8 code | str_get_id [] =STR_GET_ID |
| U8 code | str_get_status0 [] =STR_GET_STATUS0 |
| U8 code | str_get_status1 [] =STR_GET_STATUS1 |
| U8 code | str_help [] =STR_HELP |
| U8 code | str_run [] =STR_RUN |
| U8 code | str_set_speed [] =STR_SET_SPEED |
| U8 code | str_stop [] =STR_STOP |
| volatile Bool | ushell_active = FALSE |
,v
Copyright (c) 2006 Atmel.
This file manages the µshell task for communication.
Definition in file ushell_task.c.
| void build_cmd | ( | void | ) |
get the full command line to be interpreted.
| none |
Definition at line 161 of file ushell_task.c.
References ABORT_CHAR, BKSPACE_CHAR, cmd_str, CR, i_str, parse_cmd(), and uart_putchar.
Referenced by ushell_task().

| void convert_param1 | ( | void | ) |
convert param1 to binaire.
| none |
Definition at line 336 of file ushell_task.c.
References ascii_to_bin(), par_str1, and param1.
Referenced by ushell_task().

| void convert_param2 | ( | void | ) |
convert param2 to binaire.
| none |
Definition at line 353 of file ushell_task.c.
References ascii_to_bin(), par_str2, and param2.

| U16 debug_get_value1 | ( | void | ) |
| U16 debug_get_value2 | ( | void | ) |
| U8 mystrncmp | ( | U8 * | str1, |
| U8 code * | str2, | ||
| U8 | i | ||
| ) |
compares two strings located in flash code area.
| *str1 | |
| *str2 |
Definition at line 285 of file ushell_task.c.
Referenced by parse_cmd().
| void parse_cmd | ( | void | ) |
decodes full command line into command type and arguments
This function allows to set the cmd_type to the command type decoded with its respective arguments par_str1 and par_str2
| none |
Definition at line 209 of file ushell_task.c.
References cmd, CMD_BACKWARD, CMD_FORWARD, CMD_GET_ID, CMD_GET_STATUS0, CMD_GET_STATUS1, CMD_HELP, CMD_RUN, CMD_SET_SPEED, CMD_STOP, cmd_str, cmd_type, i_str, msg_er_cmd_not_found, msg_prompt, mystrncmp(), par_str1, par_str2, print_msg(), str_backward, str_forward, str_get_id, str_get_status0, str_get_status1, str_help, str_run, str_set_speed, and str_stop.
Referenced by build_cmd().

| void print_hex16 | ( | U16 | value | ) |
Display an U16 with hexa form.
Definition at line 370 of file ushell_task.c.
References bin_to_ascii(), and uart_putchar.
Referenced by ushell_task().

| void print_msg | ( | U8 code * | str | ) |
Display an ASCII code string.
| *str | pointer to string located in flash area |
Definition at line 310 of file ushell_task.c.
References uart_putchar.
Referenced by parse_cmd(), ushell_task(), and ushell_task_init().
| void ushell_task | ( | void | ) |
Entry point of the explorer task management.
This function links perform ushell task decoding to access file system functions.
| none |
Definition at line 93 of file ushell_task.c.
References BOARD_ID, build_cmd(), CCW, cmd, CMD_BACKWARD, CMD_FORWARD, CMD_GET_ID, CMD_GET_STATUS0, CMD_GET_STATUS1, CMD_HELP, CMD_NONE, CMD_RUN, CMD_SET_SPEED, CMD_STOP, cmd_type, convert_param1(), mci_backward(), mci_direction, mci_forward(), mci_get_measured_current(), mci_get_measured_speed(), mci_run(), mci_run_stop, mci_set_speed(), mci_stop(), msg_er_cmd_not_found, msg_help, msg_prompt, param1, print_hex16(), print_msg(), REV_ID, SOFT_ID, uart_putchar, and ushell_active.
Referenced by main().

| void ushell_task_init | ( | void | ) |
This function initializes the hardware/software ressources required for ushell task.
| none |
/
Definition at line 66 of file ushell_task.c.
References cmd, CMD_NONE, cmd_type, msg_prompt, msg_welcome, print_msg(), and uart_putchar.
Referenced by main().

|
static |
Definition at line 30 of file ushell_task.c.
Referenced by parse_cmd(), ushell_task(), and ushell_task_init().
|
static |
Definition at line 36 of file ushell_task.c.
Referenced by build_cmd(), and parse_cmd().
|
static |
Definition at line 31 of file ushell_task.c.
Referenced by parse_cmd(), ushell_task(), and ushell_task_init().
|
static |
Definition at line 37 of file ushell_task.c.
Referenced by build_cmd(), and parse_cmd().
| U8 code msg_er_cmd_not_found[] =MSG_ER_CMD_NOT_FOUND |
Definition at line 54 of file ushell_task.c.
Referenced by parse_cmd(), and ushell_task().
| U8 code msg_help[] =MSG_HELP |
Definition at line 53 of file ushell_task.c.
Referenced by ushell_task().
| U8 code msg_prompt[] =MSG_PROMPT |
Definition at line 51 of file ushell_task.c.
Referenced by parse_cmd(), ushell_task(), and ushell_task_init().
| U8 code msg_welcome[] =MSG_WELCOME |
Definition at line 52 of file ushell_task.c.
Referenced by ushell_task_init().
|
static |
Definition at line 32 of file ushell_task.c.
Referenced by convert_param1(), and parse_cmd().
|
static |
Definition at line 33 of file ushell_task.c.
Referenced by convert_param2(), and parse_cmd().
|
static |
Definition at line 34 of file ushell_task.c.
Referenced by convert_param1(), and ushell_task().
|
static |
Definition at line 35 of file ushell_task.c.
Referenced by convert_param2().
| S16 speed_error |
| U8 code str_backward[] =STR_BACKWARD |
Definition at line 45 of file ushell_task.c.
Referenced by parse_cmd().
| U8 code str_forward[] =STR_FORWARD |
Definition at line 44 of file ushell_task.c.
Referenced by parse_cmd().
| U8 code str_get_id[] =STR_GET_ID |
Definition at line 47 of file ushell_task.c.
Referenced by parse_cmd().
| U8 code str_get_status0[] =STR_GET_STATUS0 |
Definition at line 48 of file ushell_task.c.
Referenced by parse_cmd().
| U8 code str_get_status1[] =STR_GET_STATUS1 |
Definition at line 49 of file ushell_task.c.
Referenced by parse_cmd().
| U8 code str_help[] =STR_HELP |
Definition at line 43 of file ushell_task.c.
Referenced by parse_cmd().
| U8 code str_run[] =STR_RUN |
Definition at line 41 of file ushell_task.c.
Referenced by parse_cmd().
| U8 code str_set_speed[] =STR_SET_SPEED |
Definition at line 46 of file ushell_task.c.
Referenced by parse_cmd().
| U8 code str_stop[] =STR_STOP |
Definition at line 42 of file ushell_task.c.
Referenced by parse_cmd().
| volatile Bool ushell_active = FALSE |
Definition at line 39 of file ushell_task.c.
Referenced by main(), and ushell_task().