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

... not so much a pull request, but more a test request #132

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7ee1fca
create config.h for site specific configuration
taliesin Feb 18, 2018
c77b208
add configuration option for FET drivers
taliesin Feb 18, 2018
4e672d1
add configuration option to swap 1-wire to P0.5
taliesin Feb 18, 2018
e6f939e
support secondary heater at P0.7 (PMW2)
taliesin Feb 18, 2018
51ca75b
allow baudrate configuration for UART0
taliesin Feb 19, 2018
40d65d2
dissect main.c to allow simplification and ...
taliesin Feb 19, 2018
d9bdf9c
simplify LCD output, use printf style
taliesin Feb 19, 2018
adb8c69
cleanup static globals in main.c
taliesin Feb 19, 2018
553aa1a
add the most simple logging system
taliesin Feb 19, 2018
0e38643
clean up GUI, mostly cosmetic ...
taliesin Feb 23, 2018
1c9024c
plug in SimpleCLI from ...
taliesin Feb 24, 2018
e84eae1
shell: implement some commands
taliesin Feb 25, 2018
545d87a
shell: allow to set log levels ...
taliesin Feb 25, 2018
6125284
shell: finalize port to SimpleCLI
taliesin Feb 26, 2018
d81d3d9
change eeprom format and add save profile ...
taliesin Feb 26, 2018
17dd69b
simplify adc.c and USE_PRECISION_OPAMP
taliesin Mar 2, 2018
83d1ace
minor fixes and cosmetics, BUG with bake mode!
taliesin Mar 9, 2018
0fa4ffe
reflow: major rewrite
taliesin Mar 11, 2018
fed6aa8
fix reflow.c ...
taliesin Mar 11, 2018
d57274b
reflow.c: cosmetics and more ...
taliesin Mar 12, 2018
0b2a16e
bake mode: split menu modes
taliesin Mar 12, 2018
036fb37
reflow: change abort state to cooling state
taliesin Mar 12, 2018
5385131
bake mode: fix screen content
taliesin Mar 12, 2018
30e9f5e
reflow_profiles: move shell specifics to shell.c
taliesin Mar 19, 2018
d88700a
Add cooling screen
taliesin Mar 19, 2018
745b6b1
main.c: setup, fix fan control
taliesin Mar 21, 2018
749063c
fix format warnings and declaration of _write
taliesin Mar 22, 2018
02578c1
add -Wextra and fix the warnings, mostly cosmetic
taliesin Mar 22, 2018
7090354
tried using -O2 instead of -Os
taliesin Apr 1, 2018
8d82026
reduce interrupt latency in onewire.c
taliesin Apr 2, 2018
977eeda
serial.c: improve interrupt handling
taliesin Apr 2, 2018
963d7a3
cosmetic: rename TC_AVERAGE to TO_CONTROL
taliesin Apr 8, 2018
8526a71
fix bug in reflow.c concerning fan
taliesin Apr 14, 2018
01973ae
sensor.c: let sensor be configured, remove auto-detect
taliesin Apr 14, 2018
3677c20
Add setup screen for the LR_WEIGHTED_AVERAGE control
taliesin Apr 16, 2018
6ea2ab3
add weight to LR_WEIGHTED_AVERAGE control in shell
taliesin May 18, 2018
00ba609
tweak cooling phase with LR_WEIGHTED_AVERAGE
taliesin May 19, 2018
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
24 changes: 18 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
BASE_NAME := T-962-controller

SRC_DIR := ./src/
CLI_DIR := ./src/SimpleCLI/src/
BUILD_DIR := ./build/
TARGET := $(BUILD_DIR)$(BASE_NAME).axf


vpath %.c $(SRC_DIR)
vpath %.c $(SRC_DIR):$(CLI_DIR)
vpath %.o $(BUILD_DIR)
vpath %.d $(BUILD_DIR)

Expand All @@ -29,16 +30,22 @@ COLOR_END = $(shell echo "\033[0m")

# Source files
C_SRCS += $(wildcard $(SRC_DIR)*.c) $(BUILD_DIR)version.c
CLI_SRCS := $(wildcard $(CLI_DIR)*.c)

S_SRCS += $(wildcard $(SRC_DIR)*.s)

OBJS := $(patsubst $(SRC_DIR)%.c,$(BUILD_DIR)%.o,$(C_SRCS)) $(patsubst $(SRC_DIR)%.s,$(BUILD_DIR)%.o,$(S_SRCS))
OBJS := $(patsubst $(SRC_DIR)%.c,$(BUILD_DIR)%.o,$(C_SRCS)) \
$(patsubst $(CLI_DIR)%.c,$(BUILD_DIR)%.o,$(CLI_SRCS)) \
$(patsubst $(SRC_DIR)%.s,$(BUILD_DIR)%.o,$(S_SRCS))

C_DEPS := $(wildcard *.d)
C_FLAGS := -DNDEBUG -D__NEWLIB__ -Os -g -Wall -Wextra -std=gnu99 -Isrc -fmessage-length=0 -fno-builtin \
-ffunction-sections -fdata-sections -flto -ffat-lto-objects -mcpu=arm7tdmi

all: axf

$(BUILD_DIR)version.c: $(BUILD_DIR)tag
@echo $(OBJS)
git describe --tag --always --dirty | \
sed 's/.*/const char* Version_GetGitVersion(void) { return "&"; }/' > $@

Expand All @@ -51,21 +58,26 @@ $(BUILD_DIR)tag:

$(BUILD_DIR)%.o: $(SRC_DIR)%.c $(BUILD_DIR)tag
@echo 'Building file: $<'
$(CC) -std=gnu99 -DNDEBUG -D__NEWLIB__ -Os -g -Wall -Wunused -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -flto -ffat-lto-objects -mcpu=arm7tdmi -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
$(CC) $(C_FLAGS) -c -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $(COLOR_GREEN)$<$(COLOR_END)'
@echo ' '

$(BUILD_DIR)%.o: $(SRC_DIR)%.s $(BUILD_DIR)tag
$(BUILD_DIR)%.o: $(CLI_DIR)%.c $(BUILD_DIR)tag
@echo 'Building file: $<'
$(CC) -c -x assembler-with-cpp -I $(BUILD_DIR) -DNDEBUG -D__NEWLIB__ -mcpu=arm7tdmi -o "$@" "$<"
$(CC) $(C_FLAGS) -c -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $(COLOR_GREEN)$<$(COLOR_END)'
@echo ' '

$(BUILD_DIR)%.o: $(SRC_DIR)%.s $(BUILD_DIR)tag
@echo 'Building file: $<'
$(CC) $(C_FLAGS) -c -x assembler-with-cpp -I $(BUILD_DIR) -o "$@" "$<"
@echo 'Finished building: $(COLOR_GREEN)$<$(COLOR_END)'
@echo ' '

axf: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: MCU Linker'
$(CC) -nostdlib -Xlinker -Map="$(BUILD_DIR)$(BASE_NAME).map" -Xlinker --gc-sections -flto -Os -mcpu=arm7tdmi --specs=nano.specs -u _printf_float -u _scanf_float -T "$(BASE_NAME).ld" -o "$(TARGET)" $(OBJS) $(USER_OBJS) $(LIBS)
$(CC) $(C_FLAGS) -nostdlib -Xlinker -Map="$(BUILD_DIR)$(BASE_NAME).map" -Xlinker --gc-sections --specs=nano.specs -u _printf_float -u _scanf_float -T "$(BASE_NAME).ld" -o "$(TARGET)" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $(COLOR_GREEN)$@$(COLOR_END)'
@echo ' '
$(MAKE) --no-print-directory post-build
Expand Down
674 changes: 674 additions & 0 deletions src/SimpleCLI/LICENSE

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/SimpleCLI/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SimpleCLI
A simple command line interpreter for small embedded systems
47 changes: 47 additions & 0 deletions src/SimpleCLI/cfg/scliConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* scliConfig.h
*
* Created on: 27.01.2016
* Author: Matthias Beckert <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

#ifndef SCLI_CFG_H_
#define SCLI_CFG_H_

/*
* Usage flags
*/
#define SCLI_USE_OWN_PRINTF 0
#define SCLI_USE_OWN_STDC_FUNC 0
#define SCLI_USE_CFG_SYSTEM 0

/*
* Size configuration
*/
#define SCLI_CMD_HIST 10
#define SCLI_CMD_MAX_LEN 180
#define SCLI_CMD_MAX_ARGS 10
#define SCLI_GETCH_BUF_SIZE 20
#define SCLI_CMD_NAME_MAX_LEN 10
#define SCLI_CONF_MAX_HANDLE 10

#if SCLI_USE_OWN_PRINTF > 0
#error "Remove this line and add own printf header"
//#include "printf.h"
#endif

#endif /* SCLI_CFG_H_ */
35 changes: 35 additions & 0 deletions src/SimpleCLI/inc/scliConf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* scliConf.h
*
* Created on: 12.02.2016
* Author: Matthias Beckert <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

#ifndef SCLICONF_H_
#define SCLICONF_H_

#include "SimpleCLI/inc/scliTypes.h"

#if SCLI_USE_CFG_SYSTEM > 0

extern SCLI_CMD_RET scliConf_SetCmd(uint8_t argc, char **argv);
extern SCLI_CMD_RET scliConf_GetCmd(uint8_t argc, char **argv);
extern SCLI_CMD_RET scliConf_ConfCmd(uint8_t argc, char **argv);
extern SCLI_CFG_HANDLE_T * scliConf_RegisterConfig(const char *const Name, const char *const Desc, SCLI_CFG_ENTRY_T *Table);
#endif

#endif /* SCLICONF_H_ */
45 changes: 45 additions & 0 deletions src/SimpleCLI/inc/scliCore.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* scliCore.h
*
* Created on: 27.01.2016
* Author: Matthias Beckert <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

#ifndef SCLI_CORE_H_
#define SCLI_CORE_H_

#include "SimpleCLI/cfg/scliConfig.h"
#include "SimpleCLI/inc/scliTypes.h"
#include "SimpleCLI/inc/scliText.h"
#include "SimpleCLI/inc/scliConf.h"

#if SCLI_USE_OWN_PRINTF > 0
#include <printf.h>
#else
#include <stdio.h>
#endif

extern uint8_t scliCore_Init(SCLI_INTERFACE_T* Interface);
extern void scliCore_ExecuteCommand(SCLI_CMD_INPUT_T *InputBuffer);
extern void scliCore_ReleaseBuffer(SCLI_CMD_INPUT_T *InputBuffer);
extern int scliCore_getchar(void);
extern SCLI_CMD_T * scliCore_GetCommandInTable(char * Cmd, SCLI_CMD_T * Table, SCLI_LINE_IDX CmdLen);
extern void scliCore_PrintHelp(SCLI_CMD_T * Table, uint8_t SingleEntry);



#endif /* SCLI_CORE_H_ */
48 changes: 48 additions & 0 deletions src/SimpleCLI/inc/scliStdC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* scliStdC.h
*
* Created on: 31.01.2016
* Author: Matthias Beckert <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

#ifndef SCLISTDC_H_
#define SCLISTDC_H_

#include "SimpleCLI/cfg/scliConfig.h"
#include "SimpleCLI/inc/scliTypes.h"

#if SCLI_USE_OWN_STDC_FUNC > 0
extern uint32_t scliStdC_strlen(char *);
extern int scliStdC_strncmp(char *, char *, size_t);
extern void scliStdC_memset(void*, int8_t, size_t);
extern char * scliStdC_strncpy(char *, const char *, size_t );
extern uint32_t scliStdC_strtoul(char *, char **, int );
extern int32_t scliStdC_strtol(char *, char **, int );

#define strlen scliStdC_strlen
#define strncmp scliStdC_strncmp
#define memset scliStdC_memset
#define strncpy scliStdC_strncpy
#define strtoul scliStdC_strtoul
#define strtol scliStdC_strtol

#else
#include <string.h>
#include <stdlib.h>
#endif

#endif /* SCLISTDC_H_ */
44 changes: 44 additions & 0 deletions src/SimpleCLI/inc/scliText.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* scliText.h
*
* Created on: 31.01.2016
* Author: Matthias Beckert <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

#ifndef SCLITEXT_H_
#define SCLITEXT_H_

extern const char scliText_ColRedBold[];
extern const char scliText_ColGreBold[];
extern const char scliText_ColYelBold[];
extern const char scliText_ColBluBold[];
extern const char scliText_ColMagBold[];
extern const char scliText_ColCyaBold[];
extern const char scliText_ColDef[];
extern const char scliText_ColDefBold[];
extern const char scliText_DeleteRight[];

extern const char scliText_WelcomeMsg[];
extern const char scliText_Prompt[];
extern const char scliText_Help[];
extern const char scliText_Version[];
extern const char scliText_Set[];
extern const char scliText_Get[];
extern const char scliText_ConfNoTable[];
extern const char scliText_Conf[];

#endif /* SCLITEXT_H_ */
Loading