diff options
author | Uladzimir Pylinski <barthess@yandex.ru> | 2016-05-01 12:54:03 +0300 |
---|---|---|
committer | Uladzimir Pylinski <barthess@yandex.ru> | 2016-05-01 12:54:03 +0300 |
commit | 05a8a76ea0153fb1dded1a92ffc411002c11f612 (patch) | |
tree | 4c582c3a8e2cdb35c33d4c1bc45c6fa5c2655ce7 /demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c | |
parent | ecab016be95ecfc51d0e0708d473eaf60f5f0ac7 (diff) | |
parent | 09a35652f719e7c21fea4063484625edc4091fe6 (diff) | |
download | ChibiOS-Contrib-05a8a76ea0153fb1dded1a92ffc411002c11f612.tar.gz ChibiOS-Contrib-05a8a76ea0153fb1dded1a92ffc411002c11f612.tar.bz2 ChibiOS-Contrib-05a8a76ea0153fb1dded1a92ffc411002c11f612.zip |
Merge pull request #66 from pl4nkton/stm32_fixes
Stm32 fixes
Diffstat (limited to 'demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c')
-rw-r--r-- | demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c | 75 |
1 files changed, 10 insertions, 65 deletions
diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c index d0b07d3..aa7ac10 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c +++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c @@ -16,18 +16,17 @@ #include "ch.h"
#include "hal.h"
-#include "test.h"
#include "chprintf.h"
#include "shell.h"
-#if HAL_USE_SERIAL_USB
+#if (HAL_USE_SERIAL_USB == TRUE)
#include "usbcfg.h"
#endif
-#include "fsmc_sdram.h"
+#include "hal_fsmc_sdram.h"
#include "ili9341.h"
-#include "stm32_ltdc.h"
-#include "stm32_dma2d.h"
+#include "hal_stm32_ltdc.h"
+#include "hal_stm32_dma2d.h"
#include "res/wolf3d_vgagraph_chunk87.h"
@@ -474,7 +473,7 @@ static void dma2d_test(void) { /* Command line related. */
/*===========================================================================*/
-#if HAL_USE_SERIAL_USB
+#if (HAL_USE_SERIAL_USB == TRUE)
/* Virtual serial port over USB.*/
SerialUSBDriver SDU1;
#endif
@@ -482,57 +481,6 @@ SerialUSBDriver SDU1; #define SHELL_WA_SIZE THD_WORKING_AREA_SIZE(2048)
#define TEST_WA_SIZE THD_WORKING_AREA_SIZE(256)
-static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) {
- size_t n, size;
-
- (void)argv;
- if (argc > 0) {
- chprintf(chp, "Usage: mem\r\n");
- return;
- }
- n = chHeapStatus(NULL, &size);
- chprintf(chp, "core free memory : %u bytes\r\n", chCoreGetStatusX());
- chprintf(chp, "heap fragments : %u\r\n", n);
- chprintf(chp, "heap free total : %u bytes\r\n", size);
-}
-
-static void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[]) {
- static const char *states[] = {CH_STATE_NAMES};
- thread_t *tp;
-
- (void)argv;
- if (argc > 0) {
- chprintf(chp, "Usage: threads\r\n");
- return;
- }
- chprintf(chp, " addr stack prio refs state time\r\n");
- tp = chRegFirstThread();
- do {
- chprintf(chp, "%08lx %08lx %4lu %4lu %9s\r\n",
- (uint32_t)tp, (uint32_t)tp->p_ctx.r13,
- (uint32_t)tp->p_prio, (uint32_t)(tp->p_refs - 1),
- states[tp->p_state]);
- tp = chRegNextThread(tp);
- } while (tp != NULL);
-}
-
-static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[]) {
- thread_t *tp;
-
- (void)argv;
- if (argc > 0) {
- chprintf(chp, "Usage: test\r\n");
- return;
- }
- tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriorityX(),
- TestThread, chp);
- if (tp == NULL) {
- chprintf(chp, "out of memory\r\n");
- return;
- }
- chThdWait(tp);
-}
-
static void cmd_reset(BaseSequentialStream *chp, int argc, char *argv[]) {
(void)argv;
if (argc > 0) {
@@ -546,15 +494,12 @@ static void cmd_reset(BaseSequentialStream *chp, int argc, char *argv[]) { }
static const ShellCommand commands[] = {
- {"mem", cmd_mem},
- {"threads", cmd_threads},
- {"test", cmd_test},
{"reset", cmd_reset},
{NULL, NULL}
};
static const ShellConfig shell_cfg1 = {
-#if HAL_USE_SERIAL_USB
+#if (HAL_USE_SERIAL_USB == TRUE)
(BaseSequentialStream *)&SDU1,
#else
(BaseSequentialStream *)&SD1,
@@ -587,7 +532,7 @@ int main(void) { */
shellInit();
-#if HAL_USE_SERIAL_USB
+#if (HAL_USE_SERIAL_USB == TRUE)
/*
* Initializes a serial-over-USB CDC driver.
*/
@@ -648,13 +593,13 @@ int main(void) { */
while (true) {
if (!shelltp) {
-#if HAL_USE_SERIAL_USB
+#if (HAL_USE_SERIAL_USB == TRUE)
if (SDU1.config->usbp->state == USB_ACTIVE) {
/* Spawns a new shell.*/
- shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
+ shelltp = chThdCreateFromHeap(NULL, SHELL_WA_SIZE, "shell", NORMALPRIO, shellThread, (void *) &shell_cfg1);
}
#else
- shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
+ shelltp = chThdCreateFromHeap(NULL, SHELL_WA_SIZE, "shell", NORMALPRIO, shellThread, (void *) &shell_cfg1);
#endif
}
else {
|