auto-sync

This commit is contained in:
rusEfi 2014-12-31 17:03:34 -06:00
parent 2b3afd2ea8
commit 74ce2aa556
14 changed files with 5986 additions and 9 deletions

View File

@ -1,7 +1,7 @@
/**
* @file efifeatures.h
*
* @brief In this header we can configure which firmware modules are used.
* @brief In this header we can configure which modules are used for EGT2CAN firmware.
*
* @date Dec 23, 2014
* @author Andrey Belomutskiy, (c) 2012-2014

View File

@ -0,0 +1,9 @@
#define EXTERN_ENGINE
// this stuff is about ChibiOS 2.6 > Migration
typedef VirtualTimer virtual_timer_t;
typedef EventListener event_listener_t;
typedef Thread thread_t;
#define THD_WORKING_AREA WORKING_AREA

View File

@ -139,7 +139,7 @@
* @brief Enables the SPI subsystem.
*/
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
#define HAL_USE_SPI FALSE
#define HAL_USE_SPI TRUE
#endif
/**

View File

@ -129,7 +129,7 @@
/*
* SPI driver system settings.
*/
#define STM32_SPI_USE_SPI1 FALSE
#define STM32_SPI_USE_SPI1 TRUE
#define STM32_SPI_USE_SPI2 FALSE
#define STM32_SPI_SPI1_DMA_PRIORITY 1
#define STM32_SPI_SPI2_DMA_PRIORITY 1

View File

@ -0,0 +1,3 @@
#define baseHardwareInit() {}

View File

@ -1,13 +1,14 @@
#include "main.h"
#include "engine_configuration.h"
#include "max31855.h"
egt_cs_array_t max31855_cs;
int main_loop_started;
void firmwareError(const char *fmt, ...) {
}
/*
* Blue LED blinker thread, times are in milliseconds.
*/
@ -43,6 +44,16 @@ static msg_t Thread2(void *arg) {
}
void initSpiCs(SPIConfig *spiConfig, brain_pin_e csPin) {
spiConfig->end_cb = NULL;
// ioportid_t port = getHwPort(csPin);
// ioportmask_t pin = getHwPin(csPin);
// spiConfig->ssport = port;
// spiConfig->sspad = pin;
// mySetPadMode("chip select", port, pin, PAL_STM32_MODE_OUTPUT);
}
void runRusEfi(void) {
@ -60,16 +71,20 @@ void runRusEfi(void) {
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, NULL);
initMax31855(NULL, max31855_cs);
/*
* Normal main() thread activity, in this demo it does nothing except
* sleeping in a loop and check the button state, when the button is
* pressed the test procedure is launched with output on the serial
* driver 1.
*/
while (TRUE) {
while (true) {
// if (palReadPad(GPIOA, GPIOA_BUTTON))
// TestThread(&SD1);
chThdSleepMilliseconds(500);
chThdSleepMilliseconds(50);
printPending();
}

View File

@ -52,8 +52,12 @@ void unlockSpi(void);
#define GET_BOARD_TEST_MODE_VALUE() (!palReadPad(getHwPort(boardConfiguration->boardTestModeJumperPin), getHwPin(boardConfiguration->boardTestModeJumperPin)))
#ifdef __cplusplus
#if EFI_PROD_CODE
#include "engine.h"
void initHardware(Logging *logging, Engine *engine);
#endif /* EFI_PROD_CODE */
#endif /* __cplusplus */
#endif /* HARDWARE_H_ */

View File

@ -14,8 +14,9 @@
#include "max31855.h"
#if EFI_PROD_CODE
#include "hardware.h"
#if EFI_PROD_CODE
#include "settings.h"
#include "pin_repository.h"
#endif /* EFI_PROD_CODE */
@ -147,7 +148,9 @@ void initMax31855(SPIDriver *drv, egt_cs_array_t max31855_cs) {
addConsoleAction("egtread", (Void) egtRead);
#if EFI_PROD_CODE
turnOnSpi(SPI_DEVICE_3);
#endif /* EFI_PROD_CODE */
for (int i = 0; i < MAX31855_CS_COUNT; i++) {
if (max31855_cs[i] != GPIO_UNASSIGNED) {

View File

@ -0,0 +1,5 @@
cd ..
call update_version.bat
cd iar
iarbuild ch.ewp -clean Debug
iarbuild ch.ewp -build Debug

2601
firmware/iar_egt/ch.ewd Normal file

File diff suppressed because it is too large Load Diff

3282
firmware/iar_egt/ch.ewp Normal file

File diff suppressed because it is too large Load Diff

10
firmware/iar_egt/ch.eww Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<workspace>
<project>
<path>$WS_DIR$\ch.ewp</path>
</project>
<batchBuild/>
</workspace>

44
firmware/iar_egt/ch.icf Normal file
View File

@ -0,0 +1,44 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF;
define symbol __ICFEDIT_region_CCMRAM_start__ = 0x10000000;
define symbol __ICFEDIT_region_CCMRAM_end__ = 0x1000FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x400;
define symbol __ICFEDIT_size_heap__ = 0x400;
/**** End of ICF editor section. ###ICF###*/
/* Size of the IRQ Stack (Main Stack).*/
define symbol __ICFEDIT_size_irqstack__ = 0x1000;
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define region CCMRAM_region = mem:[from __ICFEDIT_region_CCMRAM_start__ to __ICFEDIT_region_CCMRAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {section CSTACK};
define block IRQSTACK with alignment = 8, size = __ICFEDIT_size_irqstack__ {};
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {};
define block SYSHEAP with alignment = 8 {section SYSHEAP};
define block DATABSS with alignment = 8 {readwrite, zeroinit};
initialize by copy { readwrite };
do not initialize { section .noinit };
keep { section .intvec };
place at address mem:__ICFEDIT_intvec_start__ {section .intvec};
place in ROM_region {readonly};
place at start of RAM_region {block IRQSTACK};
place in RAM_region {block DATABSS, block HEAP};
place in RAM_region {block SYSHEAP};
/* todo place in RAM_region {section .ram}; */
place at end of RAM_region {block CSTACK};
place in CCMRAM_region {section .ccm};

View File

@ -0,0 +1 @@
st-link_cli -c SWD ur -P Debug\Exe\iar.hex -Rst -Run