16
16
#include <rtdevice.h>
17
17
#include "NuMicro.h"
18
18
19
- #if defined(PKG_USING_FAL )
19
+ #if defined(RT_USING_FAL )
20
20
#include <fal.h>
21
21
#endif
22
22
28
28
29
29
/* Private functions ------------------------------------------------------------*/
30
30
static int nu_fmc_init (void );
31
- #if defined(PKG_USING_FAL )
31
+ #if defined(RT_USING_FAL )
32
32
static int aprom_read (long offset , uint8_t * buf , size_t size );
33
33
static int aprom_write (long offset , const uint8_t * buf , size_t size );
34
34
static int aprom_erase (long offset , size_t size );
35
35
36
36
static int ldrom_read (long offset , uint8_t * buf , size_t size );
37
37
static int ldrom_write (long offset , const uint8_t * buf , size_t size );
38
38
static int ldrom_erase (long offset , size_t size );
39
- #endif /* PKG_USING_FAL */
39
+ #endif /* RT_USING_FAL */
40
40
41
41
/* Public functions -------------------------------------------------------------*/
42
42
int nu_fmc_read (long offset , uint8_t * buf , size_t size );
@@ -47,10 +47,10 @@ int nu_fmc_erase(long offset, size_t size);
47
47
static rt_mutex_t g_mutex_fmc = RT_NULL ;
48
48
49
49
/* Public variables -------------------------------------------------------------*/
50
- #if defined(PKG_USING_FAL )
50
+ #if defined(RT_USING_FAL )
51
51
const struct fal_flash_dev Onchip_aprom_flash = { "OnChip_APROM" , FMC_APROM_BASE , FMC_APROM_END , FMC_FLASH_PAGE_SIZE , {NULL , aprom_read , aprom_write , aprom_erase } };
52
52
const struct fal_flash_dev Onchip_ldrom_flash = { "OnChip_LDROM" , FMC_LDROM_BASE , FMC_LDROM_END , FMC_FLASH_PAGE_SIZE , {NULL , ldrom_read , ldrom_write , ldrom_erase } };
53
- #endif /* PKG_USING_FAL */
53
+ #endif /* RT_USING_FAL */
54
54
55
55
int nu_fmc_read (long addr , uint8_t * buf , size_t size )
56
56
{
@@ -291,7 +291,7 @@ int nu_fmc_erase(long addr, size_t size)
291
291
return erased_size ;
292
292
}
293
293
294
- #if defined(PKG_USING_FAL )
294
+ #if defined(RT_USING_FAL )
295
295
296
296
static int aprom_read (long offset , uint8_t * buf , size_t size )
297
297
{
@@ -323,7 +323,7 @@ static int ldrom_erase(long offset, size_t size)
323
323
return nu_fmc_erase (Onchip_ldrom_flash .addr + offset , size );
324
324
}
325
325
326
- #endif /* PKG_USING_FAL */
326
+ #endif /* RT_USING_FAL */
327
327
328
328
static int nu_fmc_init (void )
329
329
{
@@ -334,8 +334,8 @@ static int nu_fmc_init(void)
334
334
g_mutex_fmc = rt_mutex_create ("nu_fmc_lock" , RT_IPC_FLAG_PRIO );
335
335
RT_ASSERT (g_mutex_fmc != RT_NULL );
336
336
337
- /* PKG_USING_FAL */
338
- #if defined(PKG_USING_FAL )
337
+ /* RT_USING_FAL */
338
+ #if defined(RT_USING_FAL )
339
339
fal_init ();
340
340
#endif
341
341
0 commit comments