diff options
| author | [email protected] <[email protected]> | 2012-12-30 09:39:35 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-12-30 09:39:35 +0000 |
| commit | 91197259ac3a0b8a8485c608f5da77c63e1a776e (patch) | |
| tree | 68164980e8525d355994ed307fe474ae5f9595f7 | |
| parent | 850d544bdc9f18aadeb143254ad4b73638ce705e (diff) | |
fix warning in bsp/simulator
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2562 bbd45198-f89e-11dd-88c7-29a3b14d5316
| -rw-r--r-- | bsp/simulator/applications/dfs_win32.c | 1 | ||||
| -rw-r--r-- | bsp/simulator/applications/startup.c | 2 | ||||
| -rw-r--r-- | bsp/simulator/drivers/board.c | 2 | ||||
| -rw-r--r-- | bsp/simulator/drivers/sst25vfxx_mtd_sim.c | 11 | ||||
| -rw-r--r-- | bsp/simulator/rtconfig.h | 2 | ||||
| -rw-r--r-- | bsp/simulator/rtgui_demo/snake/snake_gui.c | 3 |
6 files changed, 9 insertions, 12 deletions
diff --git a/bsp/simulator/applications/dfs_win32.c b/bsp/simulator/applications/dfs_win32.c index 1ed671f781..605d6533b4 100644 --- a/bsp/simulator/applications/dfs_win32.c +++ b/bsp/simulator/applications/dfs_win32.c @@ -80,7 +80,6 @@ static int win32_result_to_dfs(DWORD res) /* unknown error */
rt_kprintf("dfs win32 error not supported yet: %d\n", res);
return -1;
-
}
static int dfs_win32_mount(
diff --git a/bsp/simulator/applications/startup.c b/bsp/simulator/applications/startup.c index 2056d5afb2..fd46980b42 100644 --- a/bsp/simulator/applications/startup.c +++ b/bsp/simulator/applications/startup.c @@ -52,7 +52,7 @@ void rtthread_startup(void) #ifdef RT_USING_HEAP
/* init memory system */
- rt_system_heap_init((void *)heap, (void *)&heap[HEAP_SIZE - 1]);
+ rt_system_heap_init((void *)heap, (void *)&heap[RT_HEAP_SIZE - 1]);
#endif
/* init scheduler system */
diff --git a/bsp/simulator/drivers/board.c b/bsp/simulator/drivers/board.c index d85f5945f2..079071cb6e 100644 --- a/bsp/simulator/drivers/board.c +++ b/bsp/simulator/drivers/board.c @@ -26,7 +26,7 @@ rt_uint8_t *heap; rt_uint8_t *rt_hw_sram_init(void)
{
rt_uint8_t *heap;
- heap = malloc(HEAP_SIZE);
+ heap = malloc(RT_HEAP_SIZE);
if (heap == RT_NULL)
{
rt_kprintf("there is no memory in pc.");
diff --git a/bsp/simulator/drivers/sst25vfxx_mtd_sim.c b/bsp/simulator/drivers/sst25vfxx_mtd_sim.c index 315cdf665b..2c1e5a9dc2 100644 --- a/bsp/simulator/drivers/sst25vfxx_mtd_sim.c +++ b/bsp/simulator/drivers/sst25vfxx_mtd_sim.c @@ -90,8 +90,7 @@ static int sst25vfxx_write(struct rt_mtd_nor_device *device, rt_off_t position, }
static char block_buffer[BLOCK_SIZE];
-
-static rt_err_t sst25vfxx_erase_block(struct rt_mtd_nor_device *device, rt_uint32_t block)
+static rt_err_t sst25vfxx_erase_block(struct rt_mtd_nor_device *device, rt_off_t offset, rt_uint32_t length)
{
struct sst25_mtd *sst25;
int result;
@@ -103,7 +102,7 @@ static rt_err_t sst25vfxx_erase_block(struct rt_mtd_nor_device *device, rt_uint3 rt_mutex_take(&flash_lock, RT_WAITING_FOREVER);
memset(block_buffer, 0xFF, BLOCK_SIZE);
- fseek(sst25->file, block, SEEK_SET);
+ fseek(sst25->file, offset, SEEK_SET);
result = fwrite(block_buffer, BLOCK_SIZE, 1, sst25->file);
if (result < 0)
@@ -186,7 +185,7 @@ rt_err_t sst25vfxx_mtd_init(const char *nor_name, sst25->file = fopen(NOR_SIM, "rb+");
if (sst25->file == NULL)
{
- int i;
+ rt_uint32_t i;
/* create a file to simulate nor */
sst25->file = fopen(NOR_SIM, "wb+");
@@ -216,10 +215,10 @@ void nor_erase(void) rt_uint32_t index;
struct rt_mtd_nor_device *mtd;
- mtd = SST25_MTD(&_sst25_mtd);
+ mtd = RT_MTD_NOR_DEVICE(&_sst25_mtd);
for (index = mtd->block_start; index < mtd->block_end; index ++)
{
- sst25vfxx_erase_block(mtd, index * mtd->block_size);
+ sst25vfxx_erase_block(mtd, index * mtd->block_size, BLOCK_SIZE);
}
}
FINSH_FUNCTION_EXPORT(nor_erase, erase all block in SPI flash);
diff --git a/bsp/simulator/rtconfig.h b/bsp/simulator/rtconfig.h index ef5a43ea20..38ea44beeb 100644 --- a/bsp/simulator/rtconfig.h +++ b/bsp/simulator/rtconfig.h @@ -9,7 +9,7 @@ #define NORESOURCE //RT_VESRION in winuser.h
#define _CRT_ERRNO_DEFINED //errno macro redefinition
-#define HEAP_SIZE (1024*1024*2)
+#define RT_HEAP_SIZE (1024*1024*2)
/* disable some warning in MSC */
#pragma warning(disable:4273) /* to ignore: warning C4273: inconsistent dll linkage */
diff --git a/bsp/simulator/rtgui_demo/snake/snake_gui.c b/bsp/simulator/rtgui_demo/snake/snake_gui.c index e369feccaa..c25e94c4ee 100644 --- a/bsp/simulator/rtgui_demo/snake/snake_gui.c +++ b/bsp/simulator/rtgui_demo/snake/snake_gui.c @@ -17,7 +17,6 @@ #define SNAKE_HEAD_COLOR RTGUI_RGB(180, 70, 130)
#define BACKGROUND_COLOR RTGUI_RGB(153, 153, 0)
#define FOOD_COLOR RTGUI_RGB(128, 0, 0)
-#define min(a, b) ((a) < (b) ? (a) : (b))
static rtgui_timer_t *timer;
static rt_size_t room_size_x, room_size_y;
@@ -153,7 +152,7 @@ static void snake_draw(struct rtgui_widget *widget) /* draw snake. */
{
- rt_uint32_t x, y;
+ rt_int32_t x, y;
rt_bool_t first_node = RT_TRUE;
for (y = 0; y < map->height; y++)
|
