Compare commits
4 Commits
5190e3116b
...
v0.5-1
Author | SHA1 | Date | |
---|---|---|---|
fdc5bcdae3 | |||
c3dd6248a3 | |||
5c429ec894 | |||
62ef147105 |
@@ -114,7 +114,7 @@ add_executable(${ELFFILE} ${MAIN_SOURCES} ${CFG_PARSER_SRCS} ${UI_SRCS}
|
||||
${STM_PERIPH_SRCS} ${SETTINGS_SRCS} ${SAFETY_SRCS}
|
||||
${SHELLMATTA_SRCS} ${UPDATER_SRCS} ${PROFILE_SRCS}
|
||||
)
|
||||
|
||||
|
||||
add_dependencies(${ELFFILE} updater-ram-code-header-blob generate-version-header)
|
||||
|
||||
|
||||
|
Submodule stm-firmware/base64-lib updated: 251e90abf3...0418c0702d
Submodule stm-firmware/linklist-lib updated: 18b3ab377a...fdd99bad48
@@ -2,7 +2,7 @@ project(updater-ram-code)
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||
set(CMAKE_CROSSCOMPILING 1)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE "arm-none-eabi-gcc.cmake")
|
||||
|
||||
|
2
temp-profile-checker/.gitignore
vendored
2
temp-profile-checker/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
*.o
|
||||
build/*
|
@@ -1,41 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(tprcc LANGUAGES CXX)
|
||||
|
||||
set (CMAKE_CXX_STANDARD 17)
|
||||
|
||||
aux_source_directory("src" SRC_DIR)
|
||||
|
||||
set (SRC_GENERATED "${CMAKE_CURRENT_BINARY_DIR}/tpr-parser.cpp" "${CMAKE_CURRENT_BINARY_DIR}/tpr-scanner.cpp")
|
||||
|
||||
set (SOURCES
|
||||
${SRC_DIR}
|
||||
${SRC_GENERATED}
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/parser/tpr.l
|
||||
OUTPUT
|
||||
${CMAKE_CURRENT_BINARY_DIR}/tpr-scanner.cpp
|
||||
COMMAND
|
||||
flex -+ -o "${CMAKE_CURRENT_BINARY_DIR}/tpr-scanner.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/parser/tpr.l"
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/parser/tpr.ypp
|
||||
OUTPUT
|
||||
${CMAKE_CURRENT_BINARY_DIR}/tpr-parser.cpp
|
||||
COMMAND
|
||||
mkdir -p "${CMAKE_CURRENT_BINARY_DIR}/generated" && bison -o"${CMAKE_CURRENT_BINARY_DIR}/tpr-parser.cpp" --header="${CMAKE_CURRENT_BINARY_DIR}/generated/tpr-parser.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/parser/tpr.ypp"
|
||||
)
|
||||
|
||||
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${SRC_GENERATED} PROPERTIES GENERATED 1)
|
||||
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
# TEMPORARY FIx:
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
|
@@ -1,38 +0,0 @@
|
||||
#ifndef _TPR_SCANNER_HPP_
|
||||
#define _TPR_SCANNER_HPP_
|
||||
|
||||
|
||||
#if ! defined(yyFlexLexerOnce)
|
||||
#include <FlexLexer.h>
|
||||
#endif
|
||||
|
||||
#include "tpr-parser.hpp"
|
||||
#include "location.hh"
|
||||
|
||||
namespace tpr {
|
||||
|
||||
class TempProfileScanner : public yyFlexLexer{
|
||||
public:
|
||||
|
||||
TempProfileScanner(std::istream *in) : yyFlexLexer(in) {
|
||||
};
|
||||
virtual ~TempProfileScanner() {};
|
||||
|
||||
//get rid of override virtual function warning
|
||||
using FlexLexer::yylex;
|
||||
|
||||
virtual
|
||||
int yylex( tpr::TempProfileParser::semantic_type * const lval,
|
||||
tpr::TempProfileParser::location_type *location );
|
||||
// YY_DECL defined in mc_lexer.l
|
||||
// Method body created by flex in mc_lexer.yy.cc
|
||||
|
||||
private:
|
||||
/* yyval ptr */
|
||||
tpr::TempProfileParser::semantic_type *yylval = nullptr;
|
||||
};
|
||||
|
||||
} /* end namespace MC */
|
||||
|
||||
|
||||
#endif /* _TPR_SCANNER_HPP_ */
|
@@ -1,26 +0,0 @@
|
||||
%{
|
||||
#include <tpr/tpr-scanner.hpp>
|
||||
#undef YY_DECL
|
||||
#define YY_DECL int tpr::TempProfileScanner::yylex(tpr::TempProfileParser::semantic_type * const lval, tpr::TempProfileParser::location_type *loc )
|
||||
|
||||
#define YY_USER_ACTION loc->step(); loc->columns(yyleng);
|
||||
|
||||
%}
|
||||
|
||||
%option yyclass="tpr::TempProgileScanner"
|
||||
%option noyywrap
|
||||
%option never-interactive
|
||||
%option c++
|
||||
|
||||
/* Predefined rules */
|
||||
NEWLINE "\n"|"\r\n"
|
||||
SPACE " "|"\t"|"\f"
|
||||
COMMENT_BEGIN "/*"
|
||||
COMMENT_END "*/"
|
||||
COMMENT_LINE "//".*\n
|
||||
|
||||
%%
|
||||
|
||||
SPACE {return 0;}
|
||||
|
||||
%%
|
@@ -1,48 +0,0 @@
|
||||
|
||||
%language "c++"
|
||||
%require "3.2"
|
||||
%defines
|
||||
%define api.namespace {tpr}
|
||||
%define api.parser.class {TempProfileParser}
|
||||
|
||||
%define parse.error verbose
|
||||
|
||||
%code requires{
|
||||
namespace tpr {
|
||||
class TempProfileScanner;
|
||||
}
|
||||
}
|
||||
|
||||
%parse-param { TempProfileScanner &scanner }
|
||||
|
||||
%code {
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
#include <utility>
|
||||
#include <tuple>
|
||||
#include <tpr/tpr-scanner.hpp>
|
||||
#undef yylex
|
||||
#define yylex scanner.yylex
|
||||
}
|
||||
|
||||
%define api.value.type variant
|
||||
%locations
|
||||
%start tpr_file
|
||||
|
||||
%token foo
|
||||
|
||||
%%
|
||||
|
||||
tpr_file: foo
|
||||
| tpr_file foo
|
||||
;
|
||||
|
||||
|
||||
%%
|
||||
|
||||
void tpr::TempProfileParser::error(const location_type &l, const std::string &err_message)
|
||||
{
|
||||
std::cerr << "Error " << err_message << " at " << l << std::endl;
|
||||
std::abort();
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
std::cout << "Hello world" << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user