📄 flash.lst
字号:
C51 COMPILER V7.50 FLASH 03/05/2008 17:32:46 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE FLASH
OBJECT MODULE PLACED IN .\build\flash.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE flash.c OMF2 ROM(COMPACT) OPTIMIZE(9,SPEED) BROWSE MODC2 MDU_R515 DEBUG PRI
-NT(.\list\flash.lst) OBJECT(.\build\flash.obj)
line level source
1 /* Copyright (c) 2007 Nordic Semiconductor. All Rights Reserved.
2 *
3 * The information contained herein is property of Nordic Semiconductor ASA.
4 * Terms and conditions of usage are described in detail in NORDIC
5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
6 *
7 * Licensees are granted free, non-transferable use of the information. NO
8 * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
9 * the file.
10 *
11 * $LastChangedRevision: 2290 $
12 */
13
14 /** @file
15 * Flash (self) programming functions
16 *
17 * @author Ole Saether
18 *
19 */
20 #include <Nordic\reg24lu1.h>
21 #include "flash.h"
22 #include "config.h"
23
24 #ifdef USE_USERCLASS
25 #pragma userclass (code = BOOTLOADER)
26 #pragma userclass (const = BOOTLOADER)
27 #endif
28
29 void flash_page_erase(uint8_t pn)
30 {
31 1 // Enable flash write operation:
32 1 FCR = 0xAA;
33 1 FCR = 0x55;
34 1 WEN = 1;
35 1 //
36 1 // Write the page address to FCR to start the page erase
37 1 // operation:
38 1 FCR = pn;
39 1 //
40 1 // Wait for the erase operation to finish:
41 1 while(RDYN == 1)
42 1 ;
43 1 WEN = 0;
44 1 }
45
46 void flash_bytes_write(uint16_t a, uint8_t xdata *p, uint16_t n)
47 {
48 1 uint8_t xdata *data pb;
49 1
50 1 // Enable flash write operation:
51 1 FCR = 0xAA;
52 1 FCR = 0x55;
53 1 WEN = 1;
54 1 //
C51 COMPILER V7.50 FLASH 03/05/2008 17:32:46 PAGE 2
55 1 // Write the bytes directly to the flash:
56 1 pb = (uint8_t xdata *)a;
57 1 while(n--)
58 1 {
59 2 *pb++ = *p++;
60 2 //
61 2 // Wait for the write operation to finish:
62 2 while(RDYN == 1)
63 2 ;
64 2 }
65 1 WEN = 0;
66 1 }
67
68 void flash_bytes_read(uint16_t a, uint8_t xdata *p, uint16_t n)
69 {
70 1 uint8_t xdata *pb = (uint8_t xdata *)a;
71 1 while(n--)
72 1 {
73 2 *p = *pb;
74 2 pb++;
75 2 p++;
76 2 }
77 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 131 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 8
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
EDATA SIZE = ---- ----
HDATA SIZE = ---- ----
XDATA CONST SIZE = ---- ----
FAR CONST SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -