diff --git a/1_wire/main.c b/1_wire/main.c index bb00ffe..e7e2c7a 100644 --- a/1_wire/main.c +++ b/1_wire/main.c @@ -54,9 +54,9 @@ int main(){ while(1){ usbd_poll(usbd_dev); if(usbdatalen){ // there's something in USB buffer - usbdatalen = parce_incoming_buf(usbdatabuf, usbdatalen); + usbdatalen = parse_incoming_buf(usbdatabuf, usbdatalen); } - //check_and_parce_UART(USART1); // also check data in UART buffers + //check_and_parse_UART(USART1); // also check data in UART buffers check_btns(); if(Timer - Old_timer > 999){ // one-second cycle Old_timer += 1000; diff --git a/1_wire/user_proto.c b/1_wire/user_proto.c index 08a1223..5376f39 100644 --- a/1_wire/user_proto.c +++ b/1_wire/user_proto.c @@ -61,10 +61,10 @@ uint8_t show_int(int32_t v){ } /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ -int parce_incoming_buf(char *buf, int len){ +int parse_incoming_buf(char *buf, int len){ uint8_t command; //uint32_t utmp; int i = 0; diff --git a/1_wire/user_proto.h b/1_wire/user_proto.h index c3c6229..24dc159 100644 --- a/1_wire/user_proto.h +++ b/1_wire/user_proto.h @@ -45,7 +45,7 @@ void prnt(uint8_t *wrd); void print_int(int32_t N); void print_hex(uint8_t *buff, uint8_t l); -int parce_incoming_buf(char *buf, int len); +int parse_incoming_buf(char *buf, int len); void OW_printID(uint8_t N); #endif // __USER_PROTO_H__ diff --git a/DMA_GPIO/user_proto.c b/DMA_GPIO/user_proto.c index 0034c54..09c1870 100644 --- a/DMA_GPIO/user_proto.c +++ b/DMA_GPIO/user_proto.c @@ -25,7 +25,7 @@ #include "dmagpio.h" /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ void parse_incoming_buf(uint8_t *buf, int *len){ diff --git a/GPIO_TIM/user_proto.c b/GPIO_TIM/user_proto.c index 14243ff..cb48c67 100644 --- a/GPIO_TIM/user_proto.c +++ b/GPIO_TIM/user_proto.c @@ -25,7 +25,7 @@ #include "timgpio.h" /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ void parse_incoming_buf(uint8_t *buf, int *len){ diff --git a/GPS+ultrasonic/main.c b/GPS+ultrasonic/main.c index 8a05dda..a45ced8 100644 --- a/GPS+ultrasonic/main.c +++ b/GPS+ultrasonic/main.c @@ -95,7 +95,7 @@ int main(){ poll_ultrasonic(); poll_ADC(); if(usbdatalen){ // there's something in USB buffer - usbdatalen = parce_incoming_buf(usbdatabuf, usbdatalen); + usbdatalen = parse_incoming_buf(usbdatabuf, usbdatalen); } if((string = check_UART2())){ // P(string); diff --git a/GPS+ultrasonic/uart.c b/GPS+ultrasonic/uart.c index e15eb97..707e428 100644 --- a/GPS+ultrasonic/uart.c +++ b/GPS+ultrasonic/uart.c @@ -98,7 +98,7 @@ void UART_isr(uint32_t UART){ UART_buff *curbuff; // Check if we were called because of RXNE if(USART_SR(UART) & USART_SR_RXNE){ - // parce incoming byte + // parse incoming byte data = usart_recv(UART); fill_uart_RXbuff(UART, data); } diff --git a/GPS+ultrasonic/user_proto.c b/GPS+ultrasonic/user_proto.c index c1cef08..2b322fa 100644 --- a/GPS+ultrasonic/user_proto.c +++ b/GPS+ultrasonic/user_proto.c @@ -62,10 +62,10 @@ uint8_t show_int(int32_t v){ } /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ -int parce_incoming_buf(char *buf, int len){ +int parse_incoming_buf(char *buf, int len){ uint8_t command; //uint32_t utmp; int i = 0, j; diff --git a/GPS+ultrasonic/user_proto.h b/GPS+ultrasonic/user_proto.h index 4b0fc3a..69bf771 100644 --- a/GPS+ultrasonic/user_proto.h +++ b/GPS+ultrasonic/user_proto.h @@ -42,6 +42,6 @@ void prnt(uint8_t *wrd); void print_int(int32_t N); void print_hex(uint8_t *buff, uint8_t l); -int parce_incoming_buf(char *buf, int len); +int parse_incoming_buf(char *buf, int len); #endif // __USER_PROTO_H__ diff --git a/GPS/main.c b/GPS/main.c index 028dc69..4d9324a 100644 --- a/GPS/main.c +++ b/GPS/main.c @@ -86,7 +86,7 @@ int main(){ while(1){ usbd_poll(usbd_dev); if(usbdatalen){ // there's something in USB buffer - usbdatalen = parce_incoming_buf(usbdatabuf, usbdatalen); + usbdatalen = parse_incoming_buf(usbdatabuf, usbdatalen); } if((string = check_UART2())){ P(string); diff --git a/GPS/uart.c b/GPS/uart.c index e1e3b34..0876706 100644 --- a/GPS/uart.c +++ b/GPS/uart.c @@ -98,7 +98,7 @@ void UART_isr(uint32_t UART){ UART_buff *curbuff; // Check if we were called because of RXNE if(USART_SR(UART) & USART_SR_RXNE){ - // parce incoming byte + // parse incoming byte data = usart_recv(UART); fill_uart_RXbuff(UART, data); } diff --git a/GPS/user_proto.c b/GPS/user_proto.c index c9cfa99..334b0cb 100644 --- a/GPS/user_proto.c +++ b/GPS/user_proto.c @@ -58,10 +58,10 @@ uint8_t show_int(int32_t v){ } /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ -int parce_incoming_buf(char *buf, int len){ +int parse_incoming_buf(char *buf, int len){ uint8_t command; //uint32_t utmp; int i = 0; diff --git a/GPS/user_proto.h b/GPS/user_proto.h index 4b0fc3a..69bf771 100644 --- a/GPS/user_proto.h +++ b/GPS/user_proto.h @@ -42,6 +42,6 @@ void prnt(uint8_t *wrd); void print_int(int32_t N); void print_hex(uint8_t *buff, uint8_t l); -int parce_incoming_buf(char *buf, int len); +int parse_incoming_buf(char *buf, int len); #endif // __USER_PROTO_H__ diff --git a/Jeep_generator/Makefile b/Jeep_generator/Makefile index 8e33d6c..2aab10c 100644 --- a/Jeep_generator/Makefile +++ b/Jeep_generator/Makefile @@ -46,7 +46,7 @@ SCRIPT_DIR = $(OPENCM3_DIR)/scripts ############################################################################### # C flags -CFLAGS += -Os -g +CFLAGS += -O3 -g CFLAGS += -Wall -Wextra -Wshadow -Wimplicit-function-declaration CFLAGS += -Wredundant-decls # -Wmissing-prototypes -Wstrict-prototypes diff --git a/Jeep_generator/README b/Jeep_generator/README index f57938d..f8cf9c2 100644 --- a/Jeep_generator/README +++ b/Jeep_generator/README @@ -1,6 +1,6 @@ Jeep crankshaft signals generator -Speed from 180 to 6000RPM +Speed from 200 to 6000RPM Buttons "+" and "-", LEDS "MIN" and "MAX" written for chinese devboard based on STM32F103RBT6 diff --git a/Jeep_generator/jeep_generator.bin b/Jeep_generator/jeep_generator.bin index 90533a2..e65ab1e 100755 Binary files a/Jeep_generator/jeep_generator.bin and b/Jeep_generator/jeep_generator.bin differ diff --git a/Jeep_generator/main.c b/Jeep_generator/main.c index 6421f2b..7336d53 100644 --- a/Jeep_generator/main.c +++ b/Jeep_generator/main.c @@ -43,7 +43,7 @@ int main(){ while(1){ usbd_poll(usbd_dev); if(usbdatalen){ // there's something in USB buffer - usbdatalen = parce_incoming_buf(usbdatabuf, usbdatalen); + usbdatalen = parse_incoming_buf(usbdatabuf, usbdatalen); } check_btns(); if(Timer - Old_timer > 999){ // one-second cycle diff --git a/Jeep_generator/timer.c b/Jeep_generator/timer.c index f0cd5bc..2e73b8e 100644 --- a/Jeep_generator/timer.c +++ b/Jeep_generator/timer.c @@ -23,9 +23,9 @@ #include "user_proto.h" // for print_int // current speed -int32_t current_RPM = 0; +uint16_t current_RPM = 0; void get_RPM(); -uint16_t get_ARR(int32_t RPM); +uint16_t get_ARR(uint32_t RPM); // pulses: 16 1/0, 4 1/1, 16 1/0, 4 0/0, const uint8_t pulses[] = { @@ -58,8 +58,8 @@ void tim2_isr(){ GPIO_BSRR(OUTP_PORT) = OUTP_PIN; else GPIO_BSRR(OUTP_PORT) = OUTP_PIN << 16; - TIM2_SR = 0; } + TIM2_SR = 0; } /** @@ -67,14 +67,17 @@ void tim2_isr(){ * RPM = 1/tim2_arr / 40 * 60 */ void get_RPM(){ - current_RPM = 3000000 / (int32_t)TIM2_ARR; - current_RPM /= 2; + uint32_t R = 3000000 / (uint32_t)TIM2_ARR; + current_RPM = R/2; + //current_RPM = R; + //current_RPM >>= 1; // x/2 != x>>1, WTF? } // calculate TIM2_ARR by RPM -uint16_t get_ARR(int32_t RPM){ - int32_t R = 3000000 / RPM; +uint16_t get_ARR(uint32_t RPM){ + uint32_t R = 3000000 / RPM; R /= 2; + //R >>= 1; return (uint16_t)R; } diff --git a/Jeep_generator/timer.h b/Jeep_generator/timer.h index 13b7d69..855d2d4 100644 --- a/Jeep_generator/timer.h +++ b/Jeep_generator/timer.h @@ -31,13 +31,13 @@ //~ #define TM2_MAX_SPEED (250) // max & min rotation speed #define MAX_RPM (6000) -#define MIN_RPM (180) +#define MIN_RPM (200) void tim2_init(); void increase_speed(); void decrease_speed(); -extern int32_t current_RPM; +extern uint16_t current_RPM; #endif // __TIMER_H__ diff --git a/Jeep_generator/user_proto.c b/Jeep_generator/user_proto.c index ccdbabd..2827ddd 100644 --- a/Jeep_generator/user_proto.c +++ b/Jeep_generator/user_proto.c @@ -34,13 +34,13 @@ void help(){ } /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ -int parce_incoming_buf(char *buf, int len){ +int parse_incoming_buf(char *buf, int len){ uint8_t command; int i = 0; - for(; i < len; i++){ + for(; i < len; ++i){ command = buf[i]; if(!command) continue; // omit zero switch (command){ diff --git a/Jeep_generator/user_proto.h b/Jeep_generator/user_proto.h index 9228749..4201c68 100644 --- a/Jeep_generator/user_proto.h +++ b/Jeep_generator/user_proto.h @@ -42,6 +42,6 @@ void prnt(uint8_t *wrd); void print_int(int32_t N); void print_hex(uint8_t *buff, uint8_t l); -int parce_incoming_buf(char *buf, int len); +int parse_incoming_buf(char *buf, int len); #endif // __USER_PROTO_H__ diff --git a/Timelapse_keyboard/uart.c b/Timelapse_keyboard/uart.c index ef4fe36..ecaaab4 100644 --- a/Timelapse_keyboard/uart.c +++ b/Timelapse_keyboard/uart.c @@ -97,7 +97,7 @@ void UART_isr(uint32_t UART){ UART_buff *curbuff; // Check if we were called because of RXNE if(USART_SR(UART) & USART_SR_RXNE){ - // parce incoming byte + // parse incoming byte data = usart_recv(UART); fill_uart_RXbuff(UART, data); } diff --git a/Timelapse_keyboard_only_lasers/uart.c b/Timelapse_keyboard_only_lasers/uart.c index ef4fe36..ecaaab4 100644 --- a/Timelapse_keyboard_only_lasers/uart.c +++ b/Timelapse_keyboard_only_lasers/uart.c @@ -97,7 +97,7 @@ void UART_isr(uint32_t UART){ UART_buff *curbuff; // Check if we were called because of RXNE if(USART_SR(UART) & USART_SR_RXNE){ - // parce incoming byte + // parse incoming byte data = usart_recv(UART); fill_uart_RXbuff(UART, data); } diff --git a/USBCDC_template/user_proto.c b/USBCDC_template/user_proto.c index 33cc326..dc874d9 100644 --- a/USBCDC_template/user_proto.c +++ b/USBCDC_template/user_proto.c @@ -29,7 +29,7 @@ void help(){ /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ int parse_incoming_buf(char *buf, int len){ diff --git a/canon_lens/user_proto.c b/canon_lens/user_proto.c index 6cb3e5b..f7a5741 100644 --- a/canon_lens/user_proto.c +++ b/canon_lens/user_proto.c @@ -137,7 +137,7 @@ void showFval(){ } /** - * parce command buffer buf with length len + * parse command buffer buf with length len * fill uint8_t data buffer with readed data */ void parse_incoming_buf(){ diff --git a/distance_meters/main.c b/distance_meters/main.c index 2fd343a..f4c1d7a 100644 --- a/distance_meters/main.c +++ b/distance_meters/main.c @@ -56,7 +56,7 @@ int main(){ uint32_t L; usbd_poll(usbd_dev); if(usbdatalen){ // there's something in USB buffer - usbdatalen = parce_incoming_buf(usbdatabuf, usbdatalen); + usbdatalen = parse_incoming_buf(usbdatabuf, usbdatalen); } if(AWD_flag){ P("Int, value = "); diff --git a/distance_meters/user_proto.c b/distance_meters/user_proto.c index 73bd69d..8e7f3f0 100644 --- a/distance_meters/user_proto.c +++ b/distance_meters/user_proto.c @@ -59,10 +59,10 @@ uint8_t show_int(int32_t v){ } /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ -int parce_incoming_buf(char *buf, int len){ +int parse_incoming_buf(char *buf, int len){ uint8_t command; //uint32_t utmp; int i = 0; diff --git a/distance_meters/user_proto.h b/distance_meters/user_proto.h index be14383..d9af859 100644 --- a/distance_meters/user_proto.h +++ b/distance_meters/user_proto.h @@ -44,6 +44,6 @@ void prnt(uint8_t *wrd); void print_int(int32_t N); void print_hex(uint8_t *buff, uint8_t l); -int parce_incoming_buf(char *buf, int len); +int parse_incoming_buf(char *buf, int len); #endif // __USER_PROTO_H__ diff --git a/nokia5110/main.c b/nokia5110/main.c index d117073..b026cba 100644 --- a/nokia5110/main.c +++ b/nokia5110/main.c @@ -80,7 +80,7 @@ int main(){ } usbdatalen = 0; } - //check_and_parce_UART(USART1); // also check data in UART buffers + //check_and_parse_UART(USART1); // also check data in UART buffers if(Timer - Old_timer > 999){ // one-second cycle Old_timer += 1000; //print_int(Timer / 1000);newline(); diff --git a/simple_cdc/main.c b/simple_cdc/main.c index 20a7e3b..507dd09 100644 --- a/simple_cdc/main.c +++ b/simple_cdc/main.c @@ -51,9 +51,9 @@ int main(){ while(1){ usbd_poll(usbd_dev); if(usbdatalen){ // there's something in USB buffer - usbdatalen = parce_incoming_buf(usbdatabuf, usbdatalen); + usbdatalen = parse_incoming_buf(usbdatabuf, usbdatalen); } - //check_and_parce_UART(USART1); // also check data in UART buffers + //check_and_parse_UART(USART1); // also check data in UART buffers check_btns(); if(Timer - Old_timer > 999){ // one-second cycle Old_timer += 1000; diff --git a/simple_cdc/user_proto.c b/simple_cdc/user_proto.c index 5b7aa6f..3e0424c 100644 --- a/simple_cdc/user_proto.c +++ b/simple_cdc/user_proto.c @@ -57,10 +57,10 @@ uint8_t show_int(int32_t v){ } /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ -int parce_incoming_buf(char *buf, int len){ +int parse_incoming_buf(char *buf, int len){ uint8_t command; //uint32_t utmp; int i = 0; diff --git a/simple_cdc/user_proto.h b/simple_cdc/user_proto.h index 4b0fc3a..69bf771 100644 --- a/simple_cdc/user_proto.h +++ b/simple_cdc/user_proto.h @@ -42,6 +42,6 @@ void prnt(uint8_t *wrd); void print_int(int32_t N); void print_hex(uint8_t *buff, uint8_t l); -int parce_incoming_buf(char *buf, int len); +int parse_incoming_buf(char *buf, int len); #endif // __USER_PROTO_H__ diff --git a/stepper_motion/client-p2/cmdlnopts.c b/stepper_motion/client-p2/cmdlnopts.c index 59e441b..328fb3a 100644 --- a/stepper_motion/client-p2/cmdlnopts.c +++ b/stepper_motion/client-p2/cmdlnopts.c @@ -1,5 +1,5 @@ /* - * cmdlnopts.c - the only function that parce cmdln args and returns glob parameters + * cmdlnopts.c - the only function that parse cmdln args and returns glob parameters * * Copyright 2013 Edward V. Emelianoff * @@ -93,13 +93,13 @@ myoption cmdlnopts[] = { /** - * Parce command line options and return dynamically allocated structure + * Parse command line options and return dynamically allocated structure * to global parameters * @param argc - copy of argc from main * @param argv - copy of argv from main * @return allocated structure with global parameters */ -glob_pars *parce_args(int argc, char **argv){ +glob_pars *parse_args(int argc, char **argv){ int i; void *ptr; ptr = memcpy(&G, &Gdefault, sizeof(G)); assert(ptr); @@ -107,7 +107,7 @@ glob_pars *parce_args(int argc, char **argv){ /// "Использование: %s [аргументы]\n\n\tГде аргументы:\n" change_helpstring(_("Usage: %s [args]\n\n\tWhere args are:\n")); // parse arguments - parceargs(&argc, &argv, cmdlnopts); + parseargs(&argc, &argv, cmdlnopts); if(help) showhelp(-1, cmdlnopts); if(argc > 0){ /// "Игнорирую аргумент[ы]:" diff --git a/stepper_motion/client-p2/cmdlnopts.h b/stepper_motion/client-p2/cmdlnopts.h index 5b0f579..33dac79 100644 --- a/stepper_motion/client-p2/cmdlnopts.h +++ b/stepper_motion/client-p2/cmdlnopts.h @@ -1,5 +1,5 @@ /* - * cmdlnopts.h - comand line options for parceargs + * cmdlnopts.h - comand line options for parseargs * * Copyright 2013 Edward V. Emelianoff * @@ -23,7 +23,7 @@ #ifndef __CMDLNOPTS_H__ #define __CMDLNOPTS_H__ -#include "parceargs.h" +#include "parseargs.h" /* * here are some typedef's for global data @@ -35,6 +35,6 @@ typedef struct{ double relmove; // move relative current position }glob_pars; -glob_pars *parce_args(int argc, char **argv); +glob_pars *parse_args(int argc, char **argv); #endif // __CMDLNOPTS_H__ diff --git a/stepper_motion/client-p2/main.c b/stepper_motion/client-p2/main.c index eca83e8..0d1191a 100644 --- a/stepper_motion/client-p2/main.c +++ b/stepper_motion/client-p2/main.c @@ -235,7 +235,7 @@ int main(int argc, char *argv[]){ char buff[BUFLEN+1]; pthread_t motor_thread; size_t L; - Global_parameters = parce_args(argc, argv); + Global_parameters = parse_args(argc, argv); assert(Global_parameters != NULL); if(!get_shm_block(&sdat, ClientSide) || !check_shm_block(&sdat)){ fprintf(stderr, "Can't get SHM block!"); diff --git a/stepper_motion/client-p2/parceargs.c b/stepper_motion/client-p2/parseargs.c similarity index 97% rename from stepper_motion/client-p2/parceargs.c rename to stepper_motion/client-p2/parseargs.c index 4a39a81..75e8cac 100644 --- a/stepper_motion/client-p2/parceargs.c +++ b/stepper_motion/client-p2/parseargs.c @@ -1,5 +1,5 @@ /* - * parceargs.c - parcing command line arguments & print help + * parseargs.c - parsing command line arguments & print help * * Copyright 2013 Edward V. Emelianoff * @@ -27,7 +27,7 @@ #include // INT_MAX & so on #include // gettext #include // isalpha -#include "parceargs.h" +#include "parseargs.h" // macro to print help messages #ifndef PRNT @@ -135,7 +135,7 @@ int get_optind(int opt, myoption *options){ } /** - * Parce command line arguments + * Parse command line arguments * ! If arg is string, then value will be strdup'ed! * * @param argc (io) - address of argc of main(), return value of argc stay after `getopt` @@ -146,7 +146,7 @@ int get_optind(int opt, myoption *options){ * * @exit: in case of error this function show help & make `exit(-1)` */ -void parceargs(int *argc, char ***argv, myoption *options){ +void parseargs(int *argc, char ***argv, myoption *options){ char *short_options, *soptr; struct option *long_options, *loptr; size_t optsize, i; @@ -247,7 +247,7 @@ void parceargs(int *argc, char ***argv, myoption *options){ */ void showhelp(int oindex, myoption *options){ // ATTENTION: string `help` prints through macro PRNT(), by default it is gettext, - // but you can redefine it before `#include "parceargs.h"` + // but you can redefine it before `#include "parseargs.h"` int max_opt_len = 0; // max len of options substring - for right indentation const int bufsz = 255; char buf[bufsz+1]; diff --git a/stepper_motion/client-p2/parceargs.h b/stepper_motion/client-p2/parseargs.h similarity index 90% rename from stepper_motion/client-p2/parceargs.h rename to stepper_motion/client-p2/parseargs.h index d328b3e..0336e7c 100644 --- a/stepper_motion/client-p2/parceargs.h +++ b/stepper_motion/client-p2/parseargs.h @@ -1,5 +1,5 @@ /* - * parceargs.h - headers for parcing command line arguments + * parseargs.h - headers for parcing command line arguments * * Copyright 2013 Edward V. Emelianoff * @@ -19,8 +19,8 @@ * MA 02110-1301, USA. */ #pragma once -#ifndef __PARCEARGS_H__ -#define __PARCEARGS_H__ +#ifndef __PARSEARGS_H__ +#define __PARSEARGS_H__ #include // bool #include @@ -48,7 +48,7 @@ typedef bool(*argfn)(void *arg, int N); * int iarg; * myoption opts[] = { * {"value", 1, NULL, 'v', arg_int, &iarg, "char val"}, ..., end_option}; - * ..(parce args).. + * ..(parse args).. * charg = (char) iarg; */ typedef enum { @@ -58,7 +58,7 @@ typedef enum { arg_double, // double arg_float, // float arg_string, // char * - arg_function // parce_args will run function `bool (*fn)(char *optarg, int N)` + arg_function // parse_args will run function `bool (*fn)(char *optarg, int N)` } argtype; /* @@ -67,7 +67,7 @@ typedef enum { * conversion depends on .type * * ATTENTION: string `help` prints through macro PRNT(), bu default it is gettext, - * but you can redefine it before `#include "parceargs.h"` + * but you can redefine it before `#include "parseargs.h"` * * if arg is string, then value wil be strdup'ed like that: * char *str; @@ -99,8 +99,8 @@ typedef struct{ extern const char *__progname; void showhelp(int oindex, myoption *options); -void parceargs(int *argc, char ***argv, myoption *options); +void parseargs(int *argc, char ***argv, myoption *options); void change_helpstring(char *s); bool myatod(void *num, const char *str, argtype t); -#endif // __PARCEARGS_H__ +#endif // __PARSEARGS_H__ diff --git a/stepper_motion/main.c b/stepper_motion/main.c index 18fe34a..509cadc 100644 --- a/stepper_motion/main.c +++ b/stepper_motion/main.c @@ -53,9 +53,9 @@ int main(){ while(1){ usbd_poll(usbd_dev); if(usbdatalen){ // there's something in USB buffer - usbdatalen = parce_incoming_buf(usbdatabuf, usbdatalen); + usbdatalen = parse_incoming_buf(usbdatabuf, usbdatalen); } - //check_and_parce_UART(USART1); // also check data in UART buffers + //check_and_parse_UART(USART1); // also check data in UART buffers if(Timer - Old_timer > 999){ // one-second cycle Old_timer += 1000; }else if(Timer < Old_timer){ // Timer overflow diff --git a/stepper_motion/user_proto.c b/stepper_motion/user_proto.c index 67bc4f2..c4c9b52 100644 --- a/stepper_motion/user_proto.c +++ b/stepper_motion/user_proto.c @@ -51,10 +51,10 @@ void help(){ /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ -int parce_incoming_buf(char *buf, int len){ +int parse_incoming_buf(char *buf, int len){ uint8_t command; //uint32_t utmp; int i = 0; diff --git a/stepper_motion/user_proto.h b/stepper_motion/user_proto.h index 4b0fc3a..69bf771 100644 --- a/stepper_motion/user_proto.h +++ b/stepper_motion/user_proto.h @@ -42,6 +42,6 @@ void prnt(uint8_t *wrd); void print_int(int32_t N); void print_hex(uint8_t *buff, uint8_t l); -int parce_incoming_buf(char *buf, int len); +int parse_incoming_buf(char *buf, int len); #endif // __USER_PROTO_H__ diff --git a/ultrasonic/main.c b/ultrasonic/main.c index 2fd343a..f4c1d7a 100644 --- a/ultrasonic/main.c +++ b/ultrasonic/main.c @@ -56,7 +56,7 @@ int main(){ uint32_t L; usbd_poll(usbd_dev); if(usbdatalen){ // there's something in USB buffer - usbdatalen = parce_incoming_buf(usbdatabuf, usbdatalen); + usbdatalen = parse_incoming_buf(usbdatabuf, usbdatalen); } if(AWD_flag){ P("Int, value = "); diff --git a/ultrasonic/user_proto.c b/ultrasonic/user_proto.c index 73bd69d..8e7f3f0 100644 --- a/ultrasonic/user_proto.c +++ b/ultrasonic/user_proto.c @@ -59,10 +59,10 @@ uint8_t show_int(int32_t v){ } /** - * parce command buffer buf with length len + * parse command buffer buf with length len * return 0 if buffer processed or len if there's not enough data in buffer */ -int parce_incoming_buf(char *buf, int len){ +int parse_incoming_buf(char *buf, int len){ uint8_t command; //uint32_t utmp; int i = 0; diff --git a/ultrasonic/user_proto.h b/ultrasonic/user_proto.h index be14383..d9af859 100644 --- a/ultrasonic/user_proto.h +++ b/ultrasonic/user_proto.h @@ -44,6 +44,6 @@ void prnt(uint8_t *wrd); void print_int(int32_t N); void print_hex(uint8_t *buff, uint8_t l); -int parce_incoming_buf(char *buf, int len); +int parse_incoming_buf(char *buf, int len); #endif // __USER_PROTO_H__