stm32f4 target spec code compiling

This commit is contained in:
tkl 2016-08-16 09:33:49 +02:00
parent 073f5093dd
commit 39f10bd4ba
15 changed files with 23 additions and 36 deletions

View File

@ -12,7 +12,6 @@ GEN_FLAGS := \
-ffunction-sections \
-fdata-sections \
-ffreestanding \
-flto \
-fno-move-loop-invariants \
-Werror \
-Wunused \
@ -28,6 +27,7 @@ GEN_FLAGS := \
-Waggregate-return \
-Wfloat-equal \
-g3
# -flto ## behind -ffreestanding
C_FLAGS = \
-DDEBUG \
@ -62,7 +62,8 @@ L_FLAGS := \
INCLUDES += \
/opt/arm-2011.09/arm-none-eabi/include \
/opt/arm-2011.09/lib/gcc/arm-none-eabi/4.6.1/include
/opt/arm-2011.09/lib/gcc/arm-none-eabi/4.6.1/include \
source/firmware
###############################################################################
# TOOLS Section

View File

@ -12,7 +12,7 @@
#include "gpio.h"
#include "i2c.h"
#include "pwm.h"
#include "rtc.h"
//#include "rtc.h"
#include "spi.h"
#include "uart.h"
@ -66,7 +66,7 @@ int drv_close(const struct driver *driver)
ret = pwm_close((const struct pwm *)(driver->device_driver));
break;
case DRIVER_TYPE_RTC:
ret = rtc_close((const struct rtc *)(driver->device_driver));
// ret = rtc_close((const struct rtc *)(driver->device_driver));
break;
case DRIVER_TYPE_SPI:
ret = spi_close((const struct spi *)(driver->device_driver));

View File

@ -8,11 +8,8 @@
#ifndef CTX_H_
#define CTX_H_
#ifdef ARCH_MSP430
#include "msp430_ctx.h"
#endif
#ifdef ARCH_STM32F4XX
//#ifdef ARCH_STM32F4XX
#include "stm32f4xx_ctx.h"
#endif
//#endif
#endif /* CTX_H_ */

View File

@ -8,10 +8,7 @@
#ifndef IRQ_H_
#define IRQ_H_
#ifdef ARCH_MSP430
#include "msp430_irq.h"
#endif
#ifdef ARCH_STM32F4XX
//#ifdef ARCH_STM32F4XX
#include "stm32f4xx_irq.h"
#endif
//#endif
#endif /* IRQ_H_ */

View File

@ -8,11 +8,8 @@
#ifndef LOW_POWER_H_
#define LOW_POWER_H_
#ifdef ARCH_MSP430
#include "msp430_low_power.h"
#endif
#ifdef ARCH_STM32F4XX
//#ifdef ARCH_STM32F4XX
#include "stm32f4xx_low_power.h"
#endif
//#endif
#endif /* LOW_POWER_H_ */

View File

@ -8,12 +8,9 @@
#ifndef SCHEDULE_H_
#define SCHEDULE_H_
#ifdef ARCH_MSP430
#include "msp430_schedule.h"
#endif
#ifdef ARCH_STM32F4XX
//#ifdef ARCH_STM32F4XX
#include "stm32f4xx_ctx.h"
#endif
//#endif
#define schedule() arch_schedule()

View File

@ -8,11 +8,14 @@
#ifndef SOURCE_FIRMWARE_KERNEL_INCLUDE_SHELL_DATA_H_
#define SOURCE_FIRMWARE_KERNEL_INCLUDE_SHELL_DATA_H_
#pragma pack(push)
#pragma pack(1)
struct shell_object {
struct list command_list;
const struct driver *shell_device;
bool echo_on;
};
#pragma pack(pop)
struct shell_object shell_object;

View File

@ -8,11 +8,8 @@
#ifndef STACK_H_
#define STACK_H_
#ifdef ARCH_MSP430
#include "msp430_stack.h"
#endif
#ifdef ARCH_STM32F4XX
//#ifdef ARCH_STM32F4XX
#include "stm32f4xx_stack.h"
#endif
//#endif
#endif /* STACK_H_ */

View File

@ -1,7 +1,5 @@
CHECK_FOLDER += source/firmware/kernel
SUB_FOLDER += source/firmware/kernel
SRC_DIR += source/firmware/kernel
INCLUDES += source/firmware/kernel/include
INCLUDES += source/firmware/kernel/interface
DOC_SRC += source/firmware/kernel
include source/firmware/kernel/driver/driver.mk

View File

@ -21,7 +21,7 @@ extern volatile struct thread_list threads;
volatile struct thread_context *current_thread;
static struct thread_context idle_task;
static stack_t idle_stack[22]; /* 30 didn't work with tx test app. why? */
static stack_t idle_stack[22];
void idle_func(void *arg)
{
while(1) {

View File

@ -69,10 +69,10 @@ static void *cmd_list_all_commands_cb(const char *cmd)
drv_write(shell_object.shell_device, greeter, strlen(greeter));
for(i = 0; i < (len - 1); i++) {
if(NULL != it) {
struct command *cmd = (struct command *)it->data;
drv_write(shell_object.shell_device, cmd->command, strlen(cmd->command));
struct command *command = (struct command *)it->data;
drv_write(shell_object.shell_device, command->command, strlen(command->command));
drv_write(shell_object.shell_device, " - ", 3);
drv_write(shell_object.shell_device, cmd->description, strlen(cmd->description));
drv_write(shell_object.shell_device, command->description, strlen(command->description));
drv_write(shell_object.shell_device, "\r\n", 2);
it = it->next;
}