Skip to content

Commit

Permalink
Develop (#23)
Browse files Browse the repository at this point in the history
* disable button interrupt, when pushed (for bounce button), need refactor button event and add callback, refactor power.c

* refactor button events, one push one handled event

refactor UI, new button events

clean up variable

update README.md

new implement button

increment version

* added CLI, removed tomep autooff, added buzzer, minor fix, refactor code,
  • Loading branch information
cvetaevvitaliy authored Nov 7, 2020
1 parent 55d6f1a commit bbdc4d0
Show file tree
Hide file tree
Showing 127 changed files with 81,856 additions and 1,324 deletions.
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/OCD_FatShark_Power_V1.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 31 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,32 @@ SET(CMAKE_SYSTEM_VERSION 1)
cmake_minimum_required(VERSION 3.7)

set(VERSION_RELEASE 1)
set(VERSION_MAJOR 0)
set(VERSION_MINOR 9)
set(VERSION_MAJOR 1)
set(VERSION_MINOR 1)

set(VERSION_FW "${VERSION_RELEASE}.${VERSION_MAJOR}.${VERSION_MINOR}")
set(FIRMWARE_NAME firmware)
add_definitions(-DMINOR=\"${VERSION_RELEASE}\")
add_definitions(-DMAJOR=\"${VERSION_MAJOR}\")
add_definitions(-DPATCH=\"${VERSION_MINOR}\")

execute_process(COMMAND git rev-parse --abbrev-ref HEAD COMMAND cut -c1-10 OUTPUT_VARIABLE GIT_BRANCH)
string(STRIP ${GIT_BRANCH} GIT_BRANCH)
message(STATUS "GIT_BRANCH=${GIT_BRANCH}")
add_definitions(-DGIT_BRANCH=\"${GIT_BRANCH}\")
#GIT_HASH=$(shell git rev-parse --short=8 HEAD)
execute_process(COMMAND git rev-parse --short=8 HEAD OUTPUT_VARIABLE GIT_HASH)
string(STRIP ${GIT_HASH} GIT_HASH)
message(STATUS "GIT_HASH=${GIT_HASH}")
add_definitions(-DGIT_HASH=\"${GIT_HASH}\")


add_definitions(-DSOFTWARE_VERSION=\"${VERSION_FW}\")
if (DEBUG STREQUAL ON)
add_definitions(-DUSE_USB_DEBUG_PRINTF)
set(OPTIMIZATION_LEVEL -g)
else()
add_definitions(-DUSE_USB_DEBUG)
set(OPTIMIZATION_LEVEL -O2)
endif()

Expand All @@ -27,13 +43,15 @@ foreach(MCU ${TYPE_MCU_STM})
message(STM32F103T8U)
set(MCU STM32F103T8U)
set(EEPROM 0x800FC00)
add_definitions(-DMCU=\"STM32F103T8U\")
else()
add_definitions(-DSTM32F103TBU)
set(SEEK_DATA 130048)
message(STM32F103TBU)
set(MCU STM32F103TBU)
set(EEPROM 0x801FC00)
SET(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/STM32F103TBUx_FLASH.ld)
add_definitions(-DMCU=\"STM32F103TBU\")
endif()
endforeach()

Expand Down Expand Up @@ -74,6 +92,14 @@ file(GLOB_RECURSE SOURCES "startup/*.*"
"Middlewares/*.*"
"Drivers/*.*" "Src/*.*"
"Inc/*.*"
"cli/cli.c"
"cli/lib/cli_input.c"
"cli/lib/cli_log.c"
"cli/lib/cli_queue.c"
"cli/lib/cli_string.c"
"cli/lib/cli_time.c"
"cli/lib/static_memory.c"
"cli/lib/sys_call.c"
"ssd1306/*.*"
"ssd1306/Image/*.*"
"ssd1306/Fonts/*.*"
Expand All @@ -85,12 +111,13 @@ include_directories(Inc
Middlewares/ST/STM32_USB_Device_Library/Core/Inc
Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc
Drivers/CMSIS/Device/ST/STM32F1xx/Include Drivers/CMSIS/Include
ssd1306 ssd1306/Fonts ssd1306/Image Main_App)
ssd1306 ssd1306/Fonts ssd1306/Image Main_App
cli cli/lib)

add_executable(${PROJECT_NAME}.elf ${SOURCES} ${LINKER_SCRIPT})

set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -Wl,-u,_printf_float,-Map=${PROJECT_BINARY_DIR}/${PROJECT_NAME}.map")
"${CMAKE_EXE_LINKER_FLAGS} -Wl,-Map=${PROJECT_BINARY_DIR}/${PROJECT_NAME}.map")


set(BIN_FILE ${PROJECT_BINARY_DIR}/${FIRMWARE_NAME}-${VERSION_RELEASE}.${VERSION_MAJOR}.${VERSION_MINOR}.bin)
Expand Down
73 changes: 73 additions & 0 deletions Drivers/STM32F1xx_HAL_Driver/Inc/stm32_assert_template.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
******************************************************************************
* @file stm32_assert.h
* @author MCD Application Team
* @brief STM32 assert template file.
* This file should be copied to the application folder and renamed
* to stm32_assert.h.
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_ASSERT_H
#define __STM32_ASSERT_H

#ifdef __cplusplus
extern "C" {
#endif

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t *file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */

#ifdef __cplusplus
}
#endif

#endif /* __STM32_ASSERT_H */


/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Loading

0 comments on commit bbdc4d0

Please sign in to comment.