Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maintainership conversation (and some of my fixes :P) #31

Open
wants to merge 7 commits into
base: Master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ Debug
/tools/JavaConfigurator/dist/
/nbproject/private/
/Result.log
experimental settings/*-*.ini

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These might want to be shared nonetheless?

7 changes: 0 additions & 7 deletions ACAcontrollerState.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,13 @@ uint16_t ui16_x4_value = 0;
uint16_t ui16_throttle_cal_b = 0;
uint16_t ui16_battery_current_max_value = 0;
uint16_t ui16_regen_current_max_value = 0;
uint8_t ui8_possible_motor_state = 0;
uint8_t ui8_dynamic_motor_state = 0;
uint8_t ui8_BatteryVoltage = 0; //Battery Voltage read from ADC
uint8_t ui8_battery_voltage_nominal =0;
uint16_t ui16_motor_speed_erps = 0;
uint32_t ui32_erps_filtered = 0; //filtered value of erps
uint16_t ui16_virtual_erps_speed = 0;
uint16_t ui16_BatteryCurrent = 0; //Battery Current read from ADC8
uint8_t ui8_position_correction_value = 127; // in 360/256 degrees
uint8_t ui8_correction_at_angle = 127;
uint16_t ui16_ADC_iq_current = 0;
uint16_t ui16_ADC_iq_current_filtered = 0;
uint16_t ui16_control_state = 0;
uint8_t ui8_uptime = 0;

Expand All @@ -107,8 +102,6 @@ uint8_t ui8_variableDebugC = 0;

int8_t i8_motor_temperature = 0;

uint8_t uint8_t_60deg_pwm_cycles[6];
uint8_t uint8_t_hall_case[7];
uint8_t uint8_t_hall_order[6];
int8_t int8_t_hall_counter = 0;
uint8_t ui8_hall_order_counter = 5;
Expand Down
7 changes: 0 additions & 7 deletions ACAcontrollerState.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,13 @@ extern uint16_t ui16_x4_value;
extern uint16_t ui16_throttle_cal_b;
extern uint16_t ui16_battery_current_max_value;
extern uint16_t ui16_regen_current_max_value;
extern uint8_t ui8_possible_motor_state;
extern uint8_t ui8_dynamic_motor_state;
extern uint8_t ui8_BatteryVoltage;
extern uint8_t ui8_battery_voltage_nominal;
extern uint16_t ui16_motor_speed_erps;
extern uint16_t ui16_virtual_erps_speed;
extern uint32_t ui32_erps_filtered; //filtered value of erps
extern uint16_t ui16_BatteryCurrent;
extern uint8_t ui8_position_correction_value;
extern uint8_t ui8_correction_at_angle;
extern uint16_t ui16_ADC_iq_current;
extern uint16_t ui16_ADC_iq_current_filtered;
extern uint8_t ui8_speedlimit_kph;
extern uint8_t ui8_speedlimit_without_pas_kph;
extern uint8_t ui8_speedlimit_actual_kph;
Expand All @@ -79,8 +74,6 @@ extern uint8_t ui8_variableDebugC;

extern int8_t i8_motor_temperature;

extern uint8_t uint8_t_60deg_pwm_cycles[6];
extern uint8_t uint8_t_hall_case[7];
extern uint8_t uint8_t_hall_order[6];
extern int8_t int8_t_hall_counter;
extern uint8_t ui8_hall_debug_counter;
Expand Down
211 changes: 101 additions & 110 deletions Makefile_windows → Makefile
Original file line number Diff line number Diff line change
@@ -1,110 +1,101 @@
#Makefile for STM8 Examples with SDCC compiler
#Author: Saeid Yazdani
#Website: WWW.EMBEDONIX.COM
#Copyright 2016
#LICENSE: GNU-LGPL

.PHONY: all clean

#Compiler
CC = sdcc
OBJCOPY = stm8-objcopy
SIZE = stm8-size

#Platform
PLATFORM = stm8

#Product name
PNAME = main

#Directory for helpers
IDIR = StdPeriphLib/inc
SDIR = StdPeriphLib/src

# In case you ever want a different name for the main source file
MAINSRC = $(PNAME).c

ELF_SECTIONS_TO_REMOVE = -R DATA -R INITIALIZED -R SSEG -R .debug_line -R .debug_loc -R .debug_abbrev -R .debug_info -R .debug_pubnames -R .debug_frame

# These are the sources that must be compiled to .rel files:
EXTRASRCS = \
$(SDIR)/stm8s_itc.c \
$(SDIR)/stm8s_clk.c \
$(SDIR)/stm8s_iwdg.c \
$(SDIR)/stm8s_gpio.c \
$(SDIR)/stm8s_exti.c \
$(SDIR)/stm8s_uart2.c \
$(SDIR)/stm8s_tim1.c \
$(SDIR)/stm8s_tim2.c \
$(SDIR)/stm8s_adc1.c \
$(SDIR)/stm8s_flash.c \
BOdisplay.c \
ACAcontrollerState.c \
ACAeeprom.c \
ACAsetPoint.c \
ACAcommons.c \
gpio.c \
cruise_control.c \
uart.c \
adc.c \
brake.c \
timers.c \
pwm.c \
motor.c \
PAS.c \
SPEED.c \
display.c \
display_kingmeter.c

HEADERS = BOdisplay.h ACAcommons.h ACAsetPoint.h ACAcontrollerState.h ACAeeprom.h adc.h brake.h cruise_control.h gpio.h interrupts.h main.h motor.h pwm.h timers.h uart.h PAS.h SPEED.h

# The list of .rel files can be derived from the list of their source files
RELS = $(EXTRASRCS:.c=.rel)

INCLUDES = -I$(IDIR) -I.
CFLAGS = -m$(PLATFORM) --std-c99 --nolospre
ELF_FLAGS = --out-fmt-ihx --debug
LIBS =
# This just provides the conventional target name "all"; it is optional
# Note: I assume you set PNAME via some means not exhibited in your original file
all: $(PNAME)

# How to build the overall program

$(PNAME): $(MAINSRC) $(RELS)
$(CC) $(INCLUDES) $(CFLAGS) $(ELF_FLAGS) $(LIBS) $(MAINSRC) $(RELS)
# $(SIZE) $(PNAME).elf
# $(OBJCOPY) -O binary $(ELF_SECTIONS_TO_REMOVE)
# $(PNAME).elf $(PNAME).bin

# How to build any .rel file from its corresponding .c file
# GNU would have you use a pattern rule for this, but that's GNU-specific
%.rel: %.c $(HEADERS)
$(CC) -c $(INCLUDES) $(CFLAGS) $(ELF_FLAGS) $(LIBS) -o$< $<

# Suffixes appearing in suffix rules we care about.
# Necessary because .rel is not one of the standard suffixes.
.SUFFIXES: .c .rel

# hex:
# $(OBJCOPY) -O ihex $(ELF_SECTIONS_TO_REMOVE) $(PNAME).elf
# $(PNAME).ihx

# flash:
# stm8flash -cstlinkv2 -pstm8s105?6 -w$(PNAME).ihx

ENTF = cmd /C del

clean:
echo "Cleaning files..."
$(ENTF) *.asm
$(ENTF) *.rel
$(ENTF) *.lk
$(ENTF) *.lst
$(ENTF) *.rst
$(ENTF) *.sym
$(ENTF) *.cdb
$(ENTF) *.map
$(ENTF) *.adb
echo "Done."

#Original Makefile template from Saeid Yazdani (c) 2016
#LICENSE: GNU-LGPL

.PHONY: all clean

#Compiler
CC = sdcc

#Platform
PLATFORM = stm8

#Product name
PNAME = main

#Directory for helpers
IDIR = StdPeriphLib/inc
SDIR = StdPeriphLib/src

# In case you ever want a different name for the main source file
MAINSRC = $(PNAME).c

# These are the sources that must be compiled to .rel files:
EXTRASRCS = \
$(SDIR)/stm8s_itc.c \
$(SDIR)/stm8s_clk.c \
$(SDIR)/stm8s_iwdg.c \
$(SDIR)/stm8s_gpio.c \
$(SDIR)/stm8s_exti.c \
$(SDIR)/stm8s_uart2.c \
$(SDIR)/stm8s_tim1.c \
$(SDIR)/stm8s_tim2.c \
$(SDIR)/stm8s_adc1.c \
$(SDIR)/stm8s_flash.c \
BOdisplay.c \
ACAcontrollerState.c \
ACAeeprom.c \
ACAsetPoint.c \
ACAcommons.c \
gpio.c \
cruise_control.c \
uart.c \
adc.c \
brake.c \
timers.c \
pwm.c \
motor.c \
PAS.c \
SPEED.c \
display.c \
display_kingmeter.c

HEADERS = BOdisplay.h ACAcommons.h ACAsetPoint.h ACAcontrollerState.h ACAeeprom.h adc.h brake.h cruise_control.h gpio.h interrupts.h main.h motor.h pwm.h timers.h uart.h PAS.h SPEED.h

# The list of .rel files can be derived from the list of their source files
RELS = $(EXTRASRCS:.c=.rel)

INCLUDES = -I$(IDIR) -I.
CFLAGS = -m$(PLATFORM) --std-c99 --nolospre
ELF_FLAGS = --out-fmt-ihx --debug
LIBS =
# This just provides the conventional target name "all"; it is optional
# Note: I assume you set PNAME via some means not exhibited in your original file
all: $(PNAME)

# How to build the overall program

$(PNAME): $(MAINSRC) $(RELS)
$(CC) $(INCLUDES) $(CFLAGS) $(ELF_FLAGS) $(LIBS) $(MAINSRC) $(RELS)

# How to build any .rel file from its corresponding .c file
# GNU would have you use a pattern rule for this, but that's GNU-specific
%.rel: %.c $(HEADERS)
$(CC) -c $(INCLUDES) $(CFLAGS) $(ELF_FLAGS) $(LIBS) -o$< $<

# Suffixes appearing in suffix rules we care about.
# Necessary because .rel is not one of the standard suffixes.
.SUFFIXES: .c .rel


flash:
stm8flash -cstlinkv2 -pstm8s105?6 -w$(PNAME).ihx


ifeq ($(OS),Windows_NT)
ENTF = cmd /C del
else
ENTF = rm -f
endif

clean:
echo "Cleaning files..."
$(ENTF) *.asm
$(ENTF) *.rel
$(ENTF) *.lk
$(ENTF) *.lst
$(ENTF) *.rst
$(ENTF) *.sym
$(ENTF) *.cdb
$(ENTF) *.map
$(ENTF) *.adb
echo "Done."
124 changes: 0 additions & 124 deletions Makefile_linux

This file was deleted.

Binary file modified OSEC Parameter Configurator.jar
Binary file not shown.
Loading