Compare commits
No commits in common. "2b308a6b1d6f814901f3724b96109eb18db4b5aa" and "8bde6dd87b9d24625d62b395032581f7e28b60b9" have entirely different histories.
2b308a6b1d
...
8bde6dd87b
7 changed files with 12 additions and 73 deletions
|
|
@ -14,13 +14,6 @@ if(NOT UNIT_TESTING)
|
||||||
target_link_libraries(module_name
|
target_link_libraries(module_name
|
||||||
RegEdit
|
RegEdit
|
||||||
)
|
)
|
||||||
|
|
||||||
#These get defined in the toolchain files.
|
|
||||||
target_compile_options(module_name PUBLIC
|
|
||||||
${OBJECT_GEN_FLAGS}
|
|
||||||
${C_FLAGS_ARCH}
|
|
||||||
)
|
|
||||||
|
|
||||||
else()
|
else()
|
||||||
target_include_directories(module_name PUBLIC
|
target_include_directories(module_name PUBLIC
|
||||||
${CMAKE_CURRENT_LIST_DIR}
|
${CMAKE_CURRENT_LIST_DIR}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ that can be used for development.
|
||||||
|
|
||||||
- [X] Add ch32v003fun sources.
|
- [X] Add ch32v003fun sources.
|
||||||
- [X] Add example blinky default main.
|
- [X] Add example blinky default main.
|
||||||
- [X] Add useful test examples.
|
- [ ] Add useful test examples.
|
||||||
- [ ] Add useful mock examples.
|
- [ ] Add useful mock examples.
|
||||||
- [X] Get Blinky to run on hardware.
|
- [X] Get Blinky to run on hardware.
|
||||||
- [ ] Set conditional compile/linker flags?
|
- [ ] Set conditional compile/linker flags?
|
||||||
|
|
|
||||||
|
|
@ -119,14 +119,6 @@ set(C_FLAGS_ARCH "\
|
||||||
-I${ALTCLIB};\
|
-I${ALTCLIB};\
|
||||||
-nostdlib")
|
-nostdlib")
|
||||||
|
|
||||||
# For CH32V006/002/005(QingKeV)
|
|
||||||
|
|
||||||
# For CH32V20X(QingKeV)
|
|
||||||
|
|
||||||
# For CH32V30X(QingKeV)
|
|
||||||
|
|
||||||
# For CH32X03X(QingKeV)
|
|
||||||
|
|
||||||
#-------------------
|
#-------------------
|
||||||
# CFLAGS
|
# CFLAGS
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
@ -157,6 +149,7 @@ UNSET(CMAKE_CXX_FLAGS CACHE)
|
||||||
#set(LINKER_SCRIPT "./src/ch32v003.ld")
|
#set(LINKER_SCRIPT "./src/ch32v003.ld")
|
||||||
#set(LINKER_SCRIPT "${CMAKE_SOURCE_DIR}/src/linker_script.ld")
|
#set(LINKER_SCRIPT "${CMAKE_SOURCE_DIR}/src/linker_script.ld")
|
||||||
|
|
||||||
|
#set(LD_FLAGS "-lgcc")
|
||||||
set(LD_FLAGS " \
|
set(LD_FLAGS " \
|
||||||
-Wl,--print-memory-usage \
|
-Wl,--print-memory-usage \
|
||||||
-Wl,-Map=${PROJECT_NAME}.map \
|
-Wl,-Map=${PROJECT_NAME}.map \
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,6 @@ if(NOT UNIT_TESTING)
|
||||||
target_link_libraries(ADC
|
target_link_libraries(ADC
|
||||||
RegEdit
|
RegEdit
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_options(ADC PUBLIC
|
|
||||||
${OBJECT_GEN_FLAGS}
|
|
||||||
${C_FLAGS_ARCH}
|
|
||||||
)
|
|
||||||
|
|
||||||
else()
|
else()
|
||||||
target_include_directories(ADC PUBLIC
|
target_include_directories(ADC PUBLIC
|
||||||
${CMAKE_CURRENT_LIST_DIR}
|
${CMAKE_CURRENT_LIST_DIR}
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,18 @@ if(NOT UNIT_TESTING)
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_options(wwdg PUBLIC
|
target_compile_options(wwdg PUBLIC
|
||||||
${OBJECT_GEN_FLAGS}
|
-g
|
||||||
${C_FLAGS_ARCH}
|
-Os
|
||||||
|
-flto
|
||||||
|
-ffunction-sections
|
||||||
|
-fdata-sections
|
||||||
|
-fmessage-length=0
|
||||||
|
-msmall-data-limit=8
|
||||||
|
-march=rv32ec
|
||||||
|
-mabi=ilp32e
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
else()
|
else()
|
||||||
target_include_directories(wwdg PUBLIC
|
target_include_directories(wwdg PUBLIC
|
||||||
${CMAKE_CURRENT_LIST_DIR}
|
${CMAKE_CURRENT_LIST_DIR}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
# Description: mocks for wwdg cmake config.
|
|
||||||
# File: /tests/wwdg/mocks/CMakesList.txt
|
|
||||||
|
|
||||||
add_library(wwdg_mock STATIC
|
|
||||||
wwdg_hw.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(wwdg_mock PUBLIC
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
#ifndef WWDG_MOCK_H
|
|
||||||
#define WWDG_MOCK_H
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
// Stuff that we have globally.
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
bool is_enabled;
|
|
||||||
bool is_HSE;
|
|
||||||
uint32_t clock_rate;
|
|
||||||
}RISCV_APB_CLK;
|
|
||||||
|
|
||||||
/* Window WatchDog Registers*/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint16_t CTLR; /* Control Register */
|
|
||||||
uint16_t RESERVED1;
|
|
||||||
uint16_t CFGR; /* Configuration Register */
|
|
||||||
uint16_t RESERVED2;
|
|
||||||
uint16_t STATR; /* Status Register */
|
|
||||||
} WWDG_TypeDef;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void wwdg_mock_setup(WWDG_TypeDef *wwdg);
|
|
||||||
|
|
||||||
void wwdg_mock_reset(void);
|
|
||||||
|
|
||||||
void wwdg_mock_clock_tick(void);
|
|
||||||
|
|
||||||
void wwdg_mock_tick_n_times(size_t n);
|
|
||||||
|
|
||||||
#endif //WWDG_MOCK_H
|
|
||||||
Loading…
Add table
Reference in a new issue