2 Commits

Author SHA1 Message Date
6e07a363f4 Add settings module 2020-04-26 20:22:00 +02:00
cf3818040c Add support for subdirectories in create-c-file script 2020-04-26 20:20:57 +02:00
6 changed files with 98 additions and 13 deletions

View File

@@ -34,26 +34,16 @@ DEFINES += -DSHELLMATTA_HELP_ALIAS=\"?\"
# RCC Manager # RCC Manager
CFILES += stm-periph/clock-enable-manager.c CFILES += stm-periph/clock-enable-manager.c
CFILES += stm-periph/uart.c stm-periph/dma-ring-buffer.c CFILES += stm-periph/uart.c stm-periph/dma-ring-buffer.c
CFILES += digio.c CFILES += digio.c
CFILES += stm-periph/unique-id.c CFILES += stm-periph/unique-id.c
CFILES += calibration.c CFILES += calibration.c
CFILES += temp-converter.c CFILES += temp-converter.c
CFILES += rotary-encoder.c CFILES += rotary-encoder.c
CFILES += stack-check.c CFILES += stack-check.c
#CFILES += onewire-temp-sensors.c
CFILES += fatfs/diskio.c fatfs/ff.c fatfs/ffsystem.c fatfs/ffunicode.c fatfs/shimatta_sdio_driver/shimatta_sdio.c CFILES += fatfs/diskio.c fatfs/ff.c fatfs/ffsystem.c fatfs/ffunicode.c fatfs/shimatta_sdio_driver/shimatta_sdio.c
CFILES += pid-controller.c oven-driver.c CFILES += pid-controller.c oven-driver.c
CFILES += settings/settings.c settings-sd-card.c
DEFINES += -DDEBUGBUILD DEFINES += -DDEBUGBUILD

View File

@@ -2,6 +2,7 @@
import os import os
import sys import sys
import pathlib
license_header = """/* Reflow Oven Controller license_header = """/* Reflow Oven Controller
* *
@@ -22,7 +23,6 @@ license_header = """/* Reflow Oven Controller
* along with the reflow oven controller project. * along with the reflow oven controller project.
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
""" """
project_dir = os.path.dirname(os.path.realpath(__file__)) project_dir = os.path.dirname(os.path.realpath(__file__))
@@ -37,19 +37,23 @@ cpath = os.path.join(project_dir, sys.argv[1]+'.c')
hfile = sys.argv[1]+'.h' hfile = sys.argv[1]+'.h'
hpath = os.path.join(module_include_dir, hfile) hpath = os.path.join(module_include_dir, hfile)
h_define = '__'+hfile.replace('.', '_').replace('-', '_').upper()+'__' h_define = '__'+hfile.replace('.', '_').replace('-', '_').replace('/', '_').upper()+'__'
if os.path.exists(cpath) or os.path.exists(hpath): if os.path.exists(cpath) or os.path.exists(hpath):
print("File already exists! Abort!") print("File already exists! Abort!")
sys.exit() sys.exit()
print('Creating C file: %s' % (cpath)) print('Creating C file: %s' % (cpath))
cfile_folder = os.path.dirname(cpath)
pathlib.Path(cfile_folder).mkdir(parents=True, exist_ok=True)
with open(cpath, 'x') as f: with open(cpath, 'x') as f:
f.write(license_header) f.write(license_header)
f.write('\n') f.write('\n')
f.write('#include <%s>' % (os.path.join(include_prefix, hfile))) f.write('#include <%s>' % (os.path.join(include_prefix, hfile)))
print('Creating H file: %s' % (hpath)) print('Creating H file: %s' % (hpath))
hfile_folder = os.path.dirname(hpath)
pathlib.Path(hfile_folder).mkdir(parents=True, exist_ok=True)
with open(hpath, 'x') as f: with open(hpath, 'x') as f:
f.write(license_header) f.write(license_header)
f.write('\n') f.write('\n')

View File

@@ -0,0 +1,24 @@
/* Reflow Oven Controller
*
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of the Reflow Oven Controller Project.
*
* The reflow oven controller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* The Reflow Oven Control Firmware 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 the reflow oven controller project.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __SETTINGS_SETTINGS_SD_CARD_H__
#define __SETTINGS_SETTINGS_SD_CARD_H__
#endif /* __SETTINGS_SETTINGS_SD_CARD_H__ */

View File

@@ -0,0 +1,25 @@
/* Reflow Oven Controller
*
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of the Reflow Oven Controller Project.
*
* The reflow oven controller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* The Reflow Oven Control Firmware 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 the reflow oven controller project.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __SETTINGS_SETTINGS_H__
#define __SETTINGS_SETTINGS_H__
#endif /* __SETTINGS_SETTINGS_H__ */

View File

@@ -0,0 +1,21 @@
/* Reflow Oven Controller
*
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of the Reflow Oven Controller Project.
*
* The reflow oven controller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* The Reflow Oven Control Firmware 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 the reflow oven controller project.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <reflow-controller/settings/settings-sd-card.h>

View File

@@ -0,0 +1,21 @@
/* Reflow Oven Controller
*
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of the Reflow Oven Controller Project.
*
* The reflow oven controller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* The Reflow Oven Control Firmware 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 the reflow oven controller project.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <reflow-controller/settings/settings.h>