some bugs fixed, but found new (e.g. ADC always give 4095)

This commit is contained in:
Edward Emelianov
2023-02-21 23:01:43 +03:00
parent ab5f7bc87b
commit 1a8345d4f0
14 changed files with 161 additions and 70 deletions

View File

@@ -114,6 +114,10 @@ int fn_udata(_U_ uint32_t hash, _U_ char *args) WAL; // "udata" (2736127636)
int fn_usartstatus(_U_ uint32_t hash, _U_ char *args) WAL; // "usartstatus" (4007098968)
int fn_vdrive(_U_ uint32_t hash, _U_ char *args) WAL; // "vdrive" (2172773525)
int fn_vfive(_U_ uint32_t hash, _U_ char *args) WAL; // "vfive" (3017477285)
static uint32_t hashf(const char *str){
uint32_t hash = 5381;
uint32_t c;
@@ -291,6 +295,12 @@ int parsecmd(const char *str){
case CMD_USARTSTATUS:
return fn_usartstatus(h, args);
break;
case CMD_VDRIVE:
return fn_vdrive(h, args);
break;
case CMD_VFIVE:
return fn_vfive(h, args);
break;
default: break;
}
return RET_CMDNOTFOUND;

View File

@@ -65,3 +65,5 @@ int parsecmd(const char *cmdwargs);
#define CMD_TMCBUS (1906135955)
#define CMD_UDATA (2736127636)
#define CMD_USARTSTATUS (4007098968)
#define CMD_VDRIVE (2172773525)
#define CMD_VFIVE (3017477285)

View File

@@ -1,12 +1,12 @@
"absposN* - GS absolute position (in steps, setter just changes current value)\n"
"accelN* - GS accel/decel (steps/s^2)\n"
"adcN* - G ADC value (N=0..3)\n"
"button[N]* - G all or given (N=0..6) buttons' state\n"
"absposN - GS absolute position (in steps, setter just changes current value)\n"
"accelN - GS accel/decel (steps/s^2)\n"
"adcN - G ADC value (N=0..3)\n"
"button[N] - G all or given (N=0..6) buttons' state\n"
"canerrcodes - G print last CAN errcodes\n"
"canfilter - GS can filters, format: bank# FIFO# mode(M/I) num0 [num1 [num2 [num3]]]\n"
"canflood - send/clear flood message: ID byte0 ... byteN\n"
"canfloodT - GS flood period (>=0ms)\n"
"canid* - GS CAN ID of device\n"
"canid - GS CAN ID of device\n"
"canignore - GS ignore list (max 10 IDs), negative to delete\n"
"canincrflood - send incremental flood message (ID is last for 'flood', stop by 'flood')\n"
"canpause - pause IN packets displaying\n"
@@ -15,42 +15,40 @@
"cansend - send data over CAN: send ID byte0 .. byteN (N<8)\n"
"canspeed - GS CAN speed (reinit if setter)\n"
"canstat - G CAN status\n"
"delignlist* - delete ignore list\n"
"diagn[N]* - G DIAG state of motor N (or all)\n"
"dumperr* - dump error codes\n"
"dumpcmd* - dump command codes\n"
"dumpconf* - dump current configuration\n"
"emstop[N]* - emergency stop motor N or all\n"
"encposN* - GS encoder's position\n"
"encrevN* - GS max encoder's pulses per revolution\n"
"encstepmaxN* - GS maximal encoder ticks per step\n"
"encstepminN* - GS minimal encoder ticks per step\n"
"eraseflash* - erase flash data storage\n"
"esw[N]* - G end-switches state\n"
"eswreactN* - GS end-switches reaction (0 - ignore, 1 - stop@any, 2 - stop@zero)\n"
"gotoN* - GS move motor to given absolute position\n"
"gotozN* - find zero position & refresh counters\n"
"dumperr - dump error codes\n"
"dumpcmd - dump command codes\n"
"dumpconf - dump current configuration\n"
"dumpmotflags - dump motor flags' bits\n"
"emstop[N] - emergency stop motor N or all\n"
"eraseflash - erase flash data storage\n"
"esw[N] - G end-switches state\n"
"eswreactN - GS end-switches reaction (0 - ignore, 1 - stop@any, 2 - stop@zero)\n"
"gotoN - GS move motor to given absolute position\n"
"gotozN - find zero position & refresh counters\n"
"gpioconfN* - GS GPIO configuration (0 - PUin, 1 - PPout, 2 - ODout), N=0..2\n"
"gpioN* - GS GPIO values, N=0..2\n"
"maxspeedN* - GS max speed (steps per sec)\n"
"maxstepsN* - GS max steps (from zero ESW)\n"
"mcut* - G MCU T\n"
"mcuvdd* - G MCU Vdd\n"
"microstepsN* - GS microsteps settings (2^0..2^9)\n"
"minspeedN* - min speed (steps per sec)\n"
"motflagsN* - motorN flags\n"
"maxspeedN - GS max speed (steps per sec)\n"
"maxstepsN - GS max steps (from zero ESW)\n"
"mcut - G MCU T\n"
"mcuvdd - G MCU Vdd\n"
"microstepsN - GS microsteps settings (2^0..2^9)\n"
"minspeedN - min speed (steps per sec)\n"
"motflagsN - motorN flags\n"
"motmul* - GS external multiplexer status (<0 - disable, 0..7 - enable and set address)\n"
"motreinit* - re-init motors after configuration changed\n"
"ping* - echo given command back\n"
"relposN* - GS relative move (get remaining)\n"
"relslowN* - GS like 'relpos' but with slowest speed\n"
"motreinit - re-init motors after configuration changed\n"
"ping - echo given command back\n"
"relposN - GS relative move (get remaining)\n"
"relslowN - GS like 'relpos' but with slowest speed\n"
"reset - software reset\n"
"saveconf* - save current configuration\n"
"saveconf - save current configuration\n"
"screen* - GS screen enable (1) or disable (0)\n"
"speedlimit* - G limiting speed for current microsteps setting\n"
"stateN* - G motor state (0-relax, 1-accel, 2-move, 3-mvslow, 4-decel, 5-stall, 6-err)\n"
"stopN* - stop motor with deceleration\n"
"speedlimit - G limiting speed for current microsteps setting\n"
"stateN - G motor state (0-relax, 1-accel, 2-move, 3-mvslow, 4-decel, 5-stall, 6-err)\n"
"stopN - stop motor with deceleration\n"
"time - G time from start (ms)\n"
"tmcbus* - GS TMC control bus (0 - USART, 1 - SPI)\n"
"udata* - GS data by usart in slave mode (text strings, '\\n'-terminated)\n"
"usartstatus* - GS status of USART1 (0 - off, 1 - master, 2 - slave)\n"
"vdrive - G approx voltage on Vdrive\n"
"vfive - G approx voltage on 5V bus\n"

View File

@@ -15,16 +15,12 @@ canresume
cansend
canspeed
canstat
delignlist
diagn
dumperr
dumpcmd
dumpconf
dumpmotflags
emstop
encpos
encrev
encstepmax
encstepmin
eraseflash
esw
eswreact
@@ -54,3 +50,5 @@ time
tmcbus
udata
usartstatus
vdrive
vfive