Skip to content

Commit 266ead3

Browse files
authored
Merge pull request #258 from solosky/develop
WIP: 2.11.0
2 parents 2409634 + ed61ce8 commit 266ead3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2002
-1526
lines changed

.vscode/launch.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "Pixl.js JLink Debug",
1010
"cwd": "${workspaceRoot}",
1111
"executable": "fw/_build/pixljs.out",
12-
"armToolchainPath": "D:/dev/SDKs/gcc-arm-none-eabi-10-2020-q4-major/bin",
12+
"armToolchainPath": "",
1313
"request": "launch",
1414
"type": "cortex-debug",
1515
"servertype": "jlink",
@@ -22,7 +22,7 @@
2222
"name": "Pixl.js Pyocd Debug",
2323
"cwd": "${workspaceRoot}",
2424
"executable": "fw/_build/pixljs.out",
25-
"armToolchainPath": "D:/dev/SDKs/gcc-arm-none-eabi-10-2020-q4-major/bin",
25+
"armToolchainPath": "",
2626
"request": "launch",
2727
"type": "cortex-debug",
2828
"servertype": "pyocd",
@@ -35,7 +35,7 @@
3535
"name": "Pixl.js Openocd Debug",
3636
"cwd": "${workspaceRoot}",
3737
"executable": "fw/_build/pixljs.out",
38-
"armToolchainPath": "D:/dev/SDKs/gcc-arm-none-eabi-10-2020-q4-major/bin",
38+
"armToolchainPath": "",
3939
"request": "launch",
4040
"type": "cortex-debug",
4141
"servertype": "openocd",

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
"nrf_log.h": "c",
3535
"string.h": "c",
3636
"math.h": "c",
37-
"mlib_common.h": "c"
37+
"mlib_common.h": "c",
38+
"ios": "c",
39+
"limits": "c",
40+
"algorithm": "c"
3841
}
3942
}

docs/en/02-Flash-Firmware.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ First make sure your device is in off state, then press key sequences bellow to
7373
- Any key to wake up the device
7474
- LEFT
7575
- MIDDLE
76-
- LEFT X 4
76+
- LEFT X N
7777
- MIDDLE
7878

79+
If the firmware version before 2.11.x, press LEFT x 4
80+
If the firmware version after 2.11.x, press LEFT x 5
81+
7982
Now you device is on DFU mode, use any of the [nRF Connect APP](#nRF-Connect-APP) or [Directly to the Firmware Update Page](#directly-to-the-firmware-update-page) methods to upgrade the fimware.
8083

docs/en/04-Using-Firmware.md

+31-27
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ You can browse folders and files using the thumbwheel slide dial switch, pushing
4747
Once you select a .BIN file his data is used like the current amiibo, the screen shows current amiibo details like amiibo current UUID, filename and amiibo name.
4848

4949
## Amiibo details screen
50-
You can use side buttons to change the current amiibo with the next or previous one on the current folder. Pressing the middle button you can change the behavior of the current amiibo, on the sub menu:
50+
You can use side buttons to change the current amiibo with the next or previous one on the current folder.
51+
If the amiibo file is marked as read-only, an info icon will be displayed in front of the amiiboe file name line.
52+
53+
## Amiibo detail menu
54+
Pressing the middle button you can change the behavior of the current amiibo, on the sub menu:
5155

5256
| |
5357
| ------------ |
@@ -58,6 +62,8 @@ You can use side buttons to change the current amiibo with the next or previous
5862
Changes the current UUID presented to game to current amiibo. The new UUID stays in place until you change the current amiibo or select this option again.
5963
### Auto Rand. (Automatic Random)
6064
Turning ON this feature, will generate a new random UUID for the current amiibo each time a game read it. Allowing to use the same amiibo multiple times on games with restrictions.
65+
### Read-only
66+
Turning on this feature, any write operation to this tag will be denied.
6167
### Delete Tag
6268
Delete the file associated to current amiibo.
6369
### Back to Tag Details
@@ -90,32 +96,6 @@ Returns to the file list of current folder.
9096
### Back to Main Menu
9197
Exit the amiibo emulator application.
9298

93-
If you have **highlighted a storage** the properties sub menu is different:
94-
95-
| |
96-
| ------------ |
97-
| Storage Status<BR>Total Space<BR>Free Space<BR>Format…<BR>Back List<BR>Back to Main Menu |
98-
| |
99-
100-
### Storage Status
101-
Shows the current status and type of the storage, by example:
102-
```
103-
=====Not Mounted=====
104-
===Mounted[LFS]===
105-
===Mounted[FFS]===
106-
```
107-
108-
### Total Space
109-
Shows total space of the mounted storage on KB.
110-
### Free Space
111-
Shows the actual free space of the mounted storage on KB.
112-
### Format…
113-
Ask confirmation for formatting the current storage, WARNING ALL DATA WILL BE LOST!
114-
### Back to File List
115-
Returns to the file list of current folder.
116-
### Back to Main Menu
117-
Exit the amiibo emulator application.
118-
11999
----
120100
# Amiibo Database
121101
This application allows the emulation of amiibo from the list of well know ones, using legally available information like the model info, then when you select one, a new virtual amiibo is created on memory using a random UUID. In order to use this application you must to provide your «key_retail.bin» file.
@@ -193,6 +173,8 @@ List the configured slots, you can browse the slots using side buttons, select o
193173

194174
If you press and hold middle button a sub menu with the option of reset the slot is shown allowing to empty the slot.
195175

176+
If you turn on the Read-only feature, the current amiibo slot will denied write operation to this slot. An info icon will be displayed in front of the amiibo name if read-only feature is enabled.
177+
196178
## Settings…
197179
The settings menu show you the Keys status and number of slot set up.
198180

@@ -276,9 +258,15 @@ Mifare cards are commonly used for access control cards, and the device can full
276258

277259
NTAG series cards are commonly used for device identification. Supported NTAG card types include:
278260

261+
* NTAG 210
262+
* NTAG 212
279263
* NTAG 213
280264
* NTAG 215
281265
* NTAG 216
266+
* Mifire Ultralight C
267+
* Mifire Ultralight C
268+
* Mifire Ultralight EV1(640 bits)
269+
* Mifire Ultralight EV1(1312 bits)
282270

283271
Currently, a total of 8 cards are supported, with the option for customizing the number of cards in the future.
284272

@@ -317,9 +305,17 @@ Abbreviations for card types:
317305
| MF 1k | Mifare 1K | 1024 |
318306
| MF 2k | Mifare 2K | 2048 |
319307
| MF 4k | Mifare 4K | 4096 |
308+
| N210 | NTAG 210 | 80 |
309+
| N212 | NTAG 212 | 164 |
320310
| N213 | NTAG 213 | 180 |
321311
| N215 | NTAG 215 | 540 |
322312
| N216 | NTAG 216 | 924 |
313+
| MFUL | Mifare Ultralight | 64 |
314+
| MFULC | Mifare Ultralight C | 144 |
315+
| MFEV11 | Mifare Ultralight EV1(640 bits) | 80 |
316+
| MFEV21 | Mifare Ultralight EV1(1312 bits) | 164 |
317+
318+
* It will display a fav icon if the card is default card. The default card is the card that is automatically activated when the device is wakeup by NFC field presents.
323319

324320
# Main Menu
325321

@@ -342,6 +338,7 @@ Pressing the middle button allows you to enter the main menu. As follows:
342338
* Nick: The current name of the card. Pressing the middle button can enter the card name setting interface.
343339
* ID: Displays the current card ID.
344340
* Type: Displays the current card type.
341+
* Default Card: if enabled, the card will be automatically activated when the device is wakeup by NFC field presents.
345342
* Data: Pressing the middle button can manage card data.
346343
* Advanced: Pressing the middle button can enter advanced card settings.
347344
* Slot Settings: Pressing the middle button enters the slot management interface, where you can enable or disable card slots.
@@ -350,6 +347,7 @@ Pressing the middle button allows you to enter the main menu. As follows:
350347

351348
> **Special Note:**:<br/>
352349
> Some modifications need to be saved to storage when exiting to the tag details. If you have modified some configurations, be sure to enter the tag details page to save them.
350+
> The default card feature is conflict with Fast Resume. If the default card feature is enabled, the device will active the card emulator of the default card instead of the amiibo Fast Resume feature.
353351
354352
## Nick Update
355353

@@ -510,3 +508,9 @@ This option put the device in the DFU mode, allowing OTA firmware update, you ca
510508
You can go to the URL [https://thegecko.github.io/web-bluetooth-dfu/](https://thegecko.github.io/web-bluetooth-dfu/) to upload the firmware, this page also can be open through the official site [https://pixl.amiibo.xyz/](https://pixl.amiibo.xyz/)
511509
## System Reboot
512510
Allows you to reboot the device and get back to the state after you remove and put the battery.
511+
512+
## Reset Default Settings
513+
Reset all settings to default values.
514+
515+
## About Device
516+
Show Pixl.js project information, include source code repository, license.

docs/zh/02-Flash-Firmware.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,12 @@ openocd -f interface/cmsis-dap.cfg -c "transport select swd" -f target/nrf52.cfg
7373
任意键唤醒设备
7474
7575
76-
左 x 4
76+
左 x N
7777
7878

79+
如果固件版本小于 2.11.x, 按左 x 4。
80+
如果固件版本大于 2.11.x, 按左 x 5。
81+
7982
现在您的设备已经进入了DFU模式,请使用任何 [nRF Connect APP](#nRF-Connect-APP)[直接进入固件页面更新](#directly-to-the-firmware-update-page) 的方法来升级固件。
8083

8184

docs/zh/04-Using-Firmware.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,15 @@ Mifare卡片常见用于门禁卡,设备可以支持完整模拟Mifare类型
156156

157157
NTAG系列卡片常用于设备识别。支持的NTAG卡片类型有:
158158

159+
* NTAG 210
160+
* NTAG 212
159161
* NTAG 213
160162
* NTAG 215
161163
* NTAG 216
164+
* Mifire Ultralight C
165+
* Mifire Ultralight C
166+
* Mifire Ultralight EV1(640 bits)
167+
* Mifire Ultralight EV1(1312 bits)
162168

163169
目前总共支持存储8张卡片,后续开放自定义卡片数量。
164170

@@ -186,17 +192,23 @@ NTAG系列的模拟功能还是测试中,功能还不太完善,未完全模
186192
界面说明如下:
187193
* 第一行:`01` 是卡片序号,`de:ad:be:ef`是卡号。
188194
* 第二行:`卡槽 01`是当前卡的名字,可以自由设置
189-
* 第三行:`MF 1K` 显示了卡类型,类型简写见下表,`08`是卡的SAK,`04 00`是卡的ATQA 最后一个符号是写入模式,如果是存储类型标记,则允许写入,否则不允许写入
195+
* 第三行:`MF 1K` 显示了卡类型,类型简写见下表,`08`是卡的SAK,`04 00`是卡的ATQA 最后一个符号是写入模式,如果是存储类型标记,则允许写入,否则不允许写入。如果当前卡片设置了默认卡片,设备会展示一个收藏图标作为提示。
190196

191197
| 显示 | 类型 | 数据文件大小 |
192198
| ---- | --- | --- |
193199
| MF mini | Mifare Mini | 320 |
194200
| MF 1k | Mifare 1K | 1024 |
195201
| MF 2k | Mifare 2K | 2048 |
196202
| MF 4k | Mifare 4K | 4096 |
203+
| N210 | NTAG 210 | 80 |
204+
| N212 | NTAG 212 | 164 |
197205
| N213 | NTAG 213 | 180 |
198206
| N215 | NTAG 215 | 540 |
199207
| N216 | NTAG 216 | 924 |
208+
| MFUL | Mifare Ultralight | 64 |
209+
| MFULC | Mifare Ultralight C | 144 |
210+
| MFEV11 | Mifare Ultralight EV1(640 bits) | 80 |
211+
| MFEV21 | Mifare Ultralight EV1(1312 bits) | 164 |
200212

201213
# 主菜单
202214

@@ -207,6 +219,7 @@ NTAG系列的模拟功能还是测试中,功能还不太完善,未完全模
207219
|  卡名 [卡槽 01]|
208220
|  ID [de:ad:be:ef]|
209221
|  卡类型 [MiFare 1K] |
222+
|  默认卡片 []
210223
|  卡数据.. |
211224
|  卡高级设置.. |
212225
|  卡槽管理.. |
@@ -218,6 +231,7 @@ NTAG系列的模拟功能还是测试中,功能还不太完善,未完全模
218231
* 卡名:卡当前的名字,按中键可以进入设置卡名界面
219232
* ID:显示了当前卡ID
220233
* 卡类型:显示了当前卡类型
234+
* 默认卡片:如果开启默认卡片,当设备从NFC场唤醒时,默认模拟这张卡。
221235
* 卡数据:按中键可以进行卡数据管理
222236
* 卡高级设置:按中键可以进入卡高级设置
223237
* 卡槽管理:按中键进入卡槽管理界面,可以开启关闭卡槽
@@ -226,6 +240,7 @@ NTAG系列的模拟功能还是测试中,功能还不太完善,未完全模
226240

227241
> **特别注意**:<br/>
228242
> 部分的修改需要在退出到标签详情才会保存到存储,如果修改了部分配置,请务必进入到标签详情页面保存下。
243+
> 如果开启的默认卡片功能,当设备从NFC场唤醒时,会调用卡模拟器应用,默认模拟这张卡。此功能和快速唤醒功能冲突,如果设置了默认卡,快速唤醒功能不再生效。
229244
230245
## 卡名修改
231246

fw/application/Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ SRC_FILES += \
293293
$(PROJ_DIR)/app/settings/scene/settings_scene_oled_contrast.c \
294294
$(PROJ_DIR)/app/settings/scene/settings_scene_language.c \
295295
$(PROJ_DIR)/app/settings/scene/settings_scene_storage.c \
296+
$(PROJ_DIR)/app/settings/scene/settings_scene_about.c \
296297
$(PROJ_DIR)/i18n/en_US.c \
297298
$(PROJ_DIR)/i18n/zh_Hans.c \
298299
$(PROJ_DIR)/i18n/zh_TW.c \
@@ -332,7 +333,7 @@ SRC_FILES += \
332333
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/crypto1_helper.c \
333334
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_14a.c \
334335
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_mf1.c \
335-
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_ntag.c \
336+
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_mf0_ntag.c \
336337
$(CHAMELEON_ROOT)/application/src/rfid/crc_utils.c \
337338
$(CHAMELEON_ROOT)/application/src/rfid/hex_utils.c \
338339
$(CHAMELEON_ROOT)/application/src/rfid/mf1_crapto1.c \
@@ -613,10 +614,10 @@ CFLAGS += -DBOARD_$(BOARD)
613614
ifneq ($(RELEASE), 1)
614615
CFLAGS += -DDEBUG
615616
CFLAGS += -DEBUG_NRF
616-
# CFLAGS += -DU8G2_USE_LARGE_GB2312_FONT
617+
#CFLAGS += -DU8G2_USE_LARGE_FONTS
617618
else
618619
CFLAGS += -DNDEBUG
619-
CFLAGS += -DU8G2_USE_LARGE_GB2312_FONT
620+
CFLAGS += -DU8G2_USE_LARGE_FONTS
620621
endif
621622
CFLAGS += -DMBEDTLS_CONFIG_FILE=\"nrf_crypto_mbedtls_config.h\"
622623
CFLAGS += -DM_USE_THREAD_BACKEND=0
@@ -729,6 +730,7 @@ full: settingsgen
729730
gen:
730731
python3 ../scripts/amiibo_db_gen.py
731732
python3 ../scripts/i18n_gen.py
733+
python3 ../scripts/font_data_gen.py
732734
python3 ../scripts/resource_gen.py
733735

734736
flash_ocd: default

fw/application/src/app/amiibo/scene/amiibo_scene_amiibo_detail.c

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1+
#include "amiibo_helper.h"
12
#include "amiibo_scene.h"
23
#include "app_amiibo.h"
34
#include "app_timer.h"
45
#include "cwalk2.h"
6+
#include "db_header.h"
7+
#include "i18n/language.h"
58
#include "mui_list_view.h"
69
#include "nrf_log.h"
710
#include "ntag_emu.h"
8-
#include "vfs.h"
9-
#include "vfs_meta.h"
10-
#include "amiibo_helper.h"
1111
#include "ntag_store.h"
1212
#include "settings.h"
13-
#include "i18n/language.h"
14-
#include "db_header.h"
13+
#include "vfs.h"
14+
#include "vfs_meta.h"
1515

1616
#define NRF_ERR_NOT_AMIIBO -1000
1717
#define NRF_ERR_READ_ERROR -1001
@@ -70,10 +70,15 @@ static int32_t ntag_read(vfs_driver_t *p_vfs_driver, const char *path, ntag_t *n
7070
vfs_meta_t meta;
7171
memset(&meta, 0, sizeof(vfs_meta_t));
7272
vfs_meta_decode(obj.meta, sizeof(obj.meta), &meta);
73-
if(meta.has_notes){
73+
if (meta.has_notes) {
7474
memcpy(ntag->notes, meta.notes, strlen(meta.notes));
7575
}
7676

77+
NRF_LOG_INFO("has_flag:%d flag:%d", meta.has_flags, meta.flags);
78+
if (meta.has_flags && (meta.flags & VFS_OBJ_FLAG_READONLY)) {
79+
ntag->read_only = true;
80+
}
81+
7782
res = p_vfs_driver->read_file_data(path, ntag->data, 540);
7883
if (res != 540 && res != 532) {
7984
return NRF_ERR_READ_ERROR;
@@ -83,7 +88,7 @@ static int32_t ntag_read(vfs_driver_t *p_vfs_driver, const char *path, ntag_t *n
8388

8489
static void ntag_gen(void *p_context) {
8590
ret_code_t err_code;
86-
app_amiibo_t * app = p_context;
91+
app_amiibo_t *app = p_context;
8792
ntag_t *ntag_current = &app->ntag;
8893

8994
err_code = amiibo_helper_rand_amiibo_uuid(ntag_current);
@@ -136,7 +141,7 @@ static void ntag_update_cb(ntag_event_type_t type, void *context, ntag_t *p_ntag
136141
if (type == NTAG_EVENT_TYPE_WRITTEN) {
137142
ntag_update(app, p_ntag);
138143
} else if (type == NTAG_EVENT_TYPE_READ) {
139-
settings_data_t* p_settings = settings_get_data();
144+
settings_data_t *p_settings = settings_get_data();
140145
if (p_settings->auto_gen_amiibo) {
141146
app_timer_stop(m_amiibo_gen_delay_timer);
142147
app_timer_start(m_amiibo_gen_delay_timer, APP_TIMER_TICKS(1000), app);
@@ -187,7 +192,9 @@ static void amiibo_scene_amiibo_detail_reload_files(app_amiibo_t *app) {
187192
vfs_meta_t meta;
188193
memset(&meta, 0, sizeof(vfs_meta_t));
189194
vfs_meta_decode(obj.meta, sizeof(obj.meta), &meta);
190-
if (obj.type == VFS_TYPE_REG && (obj.size == NTAG_DATA_SIZE || obj.size == NTAG_TAGMO_DATA_SIZE || obj.size == NTAG_THENAYA_DATA_SIZE) &&
195+
if (obj.type == VFS_TYPE_REG &&
196+
(obj.size == NTAG_DATA_SIZE || obj.size == NTAG_TAGMO_DATA_SIZE ||
197+
obj.size == NTAG_THENAYA_DATA_SIZE) &&
191198
(!meta.has_flags || !(meta.flags & VFS_OBJ_FLAG_HIDDEN))) {
192199
string_set_str(file_name, obj.name);
193200
string_array_push_back(app->amiibo_files, file_name);

0 commit comments

Comments
 (0)