diff --git a/stm32f103t8u6-bootloader/build_number.txt b/stm32f103t8u6-bootloader/build_number.txt index e5a135a..0187835 100644 --- a/stm32f103t8u6-bootloader/build_number.txt +++ b/stm32f103t8u6-bootloader/build_number.txt @@ -1 +1 @@ -445 +446 diff --git a/stm32f103t8u6-bootloader/makefile b/stm32f103t8u6-bootloader/makefile index a8eaea8..4ebd0f9 100644 --- a/stm32f103t8u6-bootloader/makefile +++ b/stm32f103t8u6-bootloader/makefile @@ -58,7 +58,7 @@ $(addprefix $(BUILD_DIR)/,$(addsuffix .o,$(basename $(filter-out $(EXCLUDE_SOURC $(addprefix $(BUILD_DIR)/,$(addsuffix .d,$(basename $(filter-out $(EXCLUDE_SOURCES),$(notdir $(wildcard $(1)/*.c)))))): $(BUILD_DIR)/%.d: $(1)/%.c @#echo " DP $$@" - $(Q)set -e; rm -f $$@; $$(CC) -MM $$(CFLAGS) $$< > $$@.$$$$$$$$; sed 's,\($$*\)\.o[ :]*,build\/\1.o $$@ : ,g' < $$@.$$$$$$$$ > $$@; rm -f $$@.$$$$$$$$ + $(Q)set -e; rm -f $$@; $$(CC) -MM $$(CFLAGS) $$< > $$@.$$$$$$$$; sed 's,\(.*\)\.o[ :]*,build\/\1.o $$@ : ,g' < $$@.$$$$$$$$ > $$@; rm -f $$@.$$$$$$$$ endef $(foreach directory,$(SOURCE_DIRS),$(eval $(call define_compile_rules,$(directory)))) diff --git a/stm32f103t8u6/build_number.txt b/stm32f103t8u6/build_number.txt index 8c0a186..cf7ff50 100644 --- a/stm32f103t8u6/build_number.txt +++ b/stm32f103t8u6/build_number.txt @@ -1 +1 @@ -363 +359 diff --git a/stm32f103t8u6/makefile b/stm32f103t8u6/makefile index 268ada9..5de7a9f 100644 --- a/stm32f103t8u6/makefile +++ b/stm32f103t8u6/makefile @@ -66,7 +66,7 @@ endif define define_compile_rule $(addprefix $(BUILD_DIR)/,$(notdir $(1:.c=.d))): $(1) @#echo " DP $$@" - $(Q)set -e; rm -f $$@; $$(CC) -MM $$(CFLAGS) $$< > $$@.$$$$$$$$; sed 's,\($$*\)\.o[ :]*,build\/\1.o $$@ : ,g' < $$@.$$$$$$$$ > $$@; rm -f $$@.$$$$$$$$ + $(Q)set -e; rm -f $$@; $$(CC) -MM $$(CFLAGS) $$< > $$@.$$$$$$$$; sed 's,\(.*\)\.o[ :]*,build\/\1.o $$@ : ,g' < $$@.$$$$$$$$ > $$@; rm -f $$@.$$$$$$$$ $(addprefix $(BUILD_DIR)/,$(notdir $(1:.c=.o))): $(1) @echo " CC $$@" $(Q)$$(CC) $$(CFLAGS) -o $$@ -c $$< diff --git a/stm32f103t8u6/src/hpgl.c b/stm32f103t8u6/src/hpgl.c index bb93ed6..9c0d593 100644 --- a/stm32f103t8u6/src/hpgl.c +++ b/stm32f103t8u6/src/hpgl.c @@ -22,9 +22,6 @@ typedef enum HPGL_Parser_ReceivingX, HPGL_Parser_ReceivingY, - // Receiving velocity value - HPGL_Parser_ReceivingVelocity, - HPGL_Parser_Error, } HPGL_ParserState_t; @@ -48,8 +45,6 @@ void HPGL_Poll(void) static bool waiting_for_movement_queue = false; - static unsigned char current_velocity = OUTPUT_DEFAULT_VELOCITY; - if(waiting_for_movement_queue) { if(!HPGL_EnqueueMovement(waiting_movement)) @@ -105,7 +100,6 @@ void HPGL_Poll(void) // Initialise HPGL_ParseErrorCounter = 0; // No parameters expected for this one - current_velocity = OUTPUT_DEFAULT_VELOCITY; state = HPGL_Parser_Idle; break; @@ -117,7 +111,6 @@ void HPGL_Poll(void) case INST('P', 'U'): // Movement with pen up current_movement.pen_down = false; - current_movement.velocity = current_velocity; current_movement.x = 0; current_movement.y = 0; state = HPGL_Parser_ReceivingX; @@ -126,24 +119,11 @@ void HPGL_Poll(void) case INST('P', 'D'): // Movement with pen down current_movement.pen_down = true; - current_movement.velocity = current_velocity; current_movement.x = 0; current_movement.y = 0; state = HPGL_Parser_ReceivingX; break; - case INST('V', 'N'): - // Reset velocity to default - current_velocity = OUTPUT_DEFAULT_VELOCITY; - state = HPGL_Parser_Idle; - break; - - case INST('V', 'S'): - // Velocity set - current_velocity = 0; - state = HPGL_Parser_ReceivingVelocity; - break; - default: // Unsupported instruction HPGL_ParseErrorCounter++; @@ -233,25 +213,6 @@ void HPGL_Poll(void) } break; - case HPGL_Parser_ReceivingVelocity: - if(character == ';' || character == '\n') - { - // Command finished - state = HPGL_Parser_Idle; - } - else if(character >= '0' && character <= '9') - { - unsigned int digit = character - '0'; - current_velocity = current_velocity * 10 + digit; - } - else - { - // The VS command could come with a pen number after a comma. - // This is currently unsupported. - state = HPGL_Parser_Error; - } - break; - case HPGL_Parser_Error: // Exit error state only after end of command if(character == '\n' || character == ';') diff --git a/stm32f103t8u6/src/hpgl.h b/stm32f103t8u6/src/hpgl.h index 00b39e1..afb49e9 100644 --- a/stm32f103t8u6/src/hpgl.h +++ b/stm32f103t8u6/src/hpgl.h @@ -5,7 +5,6 @@ typedef struct { bool pen_down; - unsigned char velocity; unsigned int x; unsigned int y; } HPGL_Movement_t; diff --git a/stm32f103t8u6/src/pwm_output.c b/stm32f103t8u6/src/pwm_output.c index b7e9226..6aa5898 100644 --- a/stm32f103t8u6/src/pwm_output.c +++ b/stm32f103t8u6/src/pwm_output.c @@ -30,7 +30,7 @@ static Output_Coordinate_t Output_CurrentLineStart = {0, 0}; static Output_Coordinate_t Output_CurrentLineEnd = {0, 0}; static unsigned int Output_CurrentLineLength; static unsigned int Output_CurrentLinePosition; -static unsigned int Output_CurrentVelocity = OUTPUT_DEFAULT_VELOCITY; +static unsigned int Output_CurrentVelocity = OUTPUT_LENGTH_SCALE / 3; bool Output_EnqueueMovement(HPGL_Movement_t movement) { @@ -52,10 +52,6 @@ bool Output_EnqueueMovement(HPGL_Movement_t movement) { movement.y = OUTPUT_COORDINATE_LIMIT; } - if(movement.velocity > OUTPUT_MAXIMUM_VELOCITY) - { - movement.velocity = OUTPUT_MAXIMUM_VELOCITY; - } memcpy(Output_BufferWrite, &movement, sizeof(HPGL_Movement_t)); Output_BufferWrite++; @@ -132,7 +128,6 @@ static bool Output_FetchNextPoint(void) Output_CurrentLineEnd.x - Output_CurrentLineStart.x, Output_CurrentLineEnd.y - Output_CurrentLineStart.y); Output_CurrentLinePosition = 0; - Output_CurrentVelocity = movement->velocity; Output_BufferRead++; if(Output_BufferRead >= Output_Buffer + CONFIG_BUFFER_MOVEMENTS) diff --git a/stm32f103t8u6/src/pwm_output.h b/stm32f103t8u6/src/pwm_output.h index 7fa7356..70896f6 100644 --- a/stm32f103t8u6/src/pwm_output.h +++ b/stm32f103t8u6/src/pwm_output.h @@ -17,11 +17,6 @@ // overflows during coordinate calculations. #define OUTPUT_LENGTH_SCALE (1 << 3) -// If no velocity is sett via a ‘VS’ command or ‘VN’ is invoked, use this -// velocity setting -#define OUTPUT_DEFAULT_VELOCITY (OUTPUT_LENGTH_SCALE / 3) -#define OUTPUT_MAXIMUM_VELOCITY (OUTPUT_LENGTH_SCALE) // TODO: Check value - // Delay after initiating pen-up/-down before continuing movements #define OUTPUT_PEN_UP_DELAY 200 // In movement timer ticks #define OUTPUT_PEN_DOWN_DELAY 20 // In movement timer ticks