Compare commits

..

No commits in common. "2b308a6b1d6f814901f3724b96109eb18db4b5aa" and "8bde6dd87b9d24625d62b395032581f7e28b60b9" have entirely different histories.

7 changed files with 12 additions and 73 deletions

View file

@ -14,13 +14,6 @@ if(NOT UNIT_TESTING)
target_link_libraries(module_name
RegEdit
)
#These get defined in the toolchain files.
target_compile_options(module_name PUBLIC
${OBJECT_GEN_FLAGS}
${C_FLAGS_ARCH}
)
else()
target_include_directories(module_name PUBLIC
${CMAKE_CURRENT_LIST_DIR}

View file

@ -94,7 +94,7 @@ that can be used for development.
- [X] Add ch32v003fun sources.
- [X] Add example blinky default main.
- [X] Add useful test examples.
- [ ] Add useful test examples.
- [ ] Add useful mock examples.
- [X] Get Blinky to run on hardware.
- [ ] Set conditional compile/linker flags?

View file

@ -119,14 +119,6 @@ set(C_FLAGS_ARCH "\
-I${ALTCLIB};\
-nostdlib")
# For CH32V006/002/005(QingKeV)
# For CH32V20X(QingKeV)
# For CH32V30X(QingKeV)
# For CH32X03X(QingKeV)
#-------------------
# CFLAGS
#-------------------
@ -157,6 +149,7 @@ UNSET(CMAKE_CXX_FLAGS CACHE)
#set(LINKER_SCRIPT "./src/ch32v003.ld")
#set(LINKER_SCRIPT "${CMAKE_SOURCE_DIR}/src/linker_script.ld")
#set(LD_FLAGS "-lgcc")
set(LD_FLAGS " \
-Wl,--print-memory-usage \
-Wl,-Map=${PROJECT_NAME}.map \

View file

@ -11,12 +11,6 @@ if(NOT UNIT_TESTING)
target_link_libraries(ADC
RegEdit
)
target_compile_options(ADC PUBLIC
${OBJECT_GEN_FLAGS}
${C_FLAGS_ARCH}
)
else()
target_include_directories(ADC PUBLIC
${CMAKE_CURRENT_LIST_DIR}

View file

@ -16,10 +16,18 @@ if(NOT UNIT_TESTING)
)
target_compile_options(wwdg PUBLIC
${OBJECT_GEN_FLAGS}
${C_FLAGS_ARCH}
-g
-Os
-flto
-ffunction-sections
-fdata-sections
-fmessage-length=0
-msmall-data-limit=8
-march=rv32ec
-mabi=ilp32e
)
else()
target_include_directories(wwdg PUBLIC
${CMAKE_CURRENT_LIST_DIR}

View file

@ -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}
)

View file

@ -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