-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.txt
67 lines (52 loc) · 2.55 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
,-------.
---( Files )---
`-------'
README.md - User Manual : Body [github markdown]
_images/ - User Manual : Images
_images/GIMP/ - User Manual : GIMP image masters
LICENSE - Tech Docs : MIT Licence file
README.txt - Tech Docs : Dev notes
notes.txt - Tech Docs : Random dev notes
info.sh - Tech Docs : Retrieve info from source code
application.fam - FAP : Header file
WiiEC.png - FAP : Icon {10x10}
gfx/ - Analyser : Images [generated by bc_image_tool]
wii_anal.c|h - Analyser : Main application
wii_anal_ec.c|h - Analyser : Extension controller actions
wii_anal_keys.c|h - Analyser : Keyboard handling
wii_anal_lcd.c|h - Analyser : LCD handling
i2c_workaround.h - Temporary workaround for i2c bug in FZ code
err.h - Errors
bc_logging.h - Logging macros - especially LOG_LEVEL
wii_i2c.c|h - i2c functionality
wii_ec.c|h - Extension Controller basic functions
wii_ec_macros.h - Bespoke Extension Controller handy-dandy MACROs
wii_ec_classic.c|h - EC: Classic Controller Pro scene
wii_ec_nunchuck.c|h - EC: Nunchuck scene
wii_ec_udraw.c|h - EC: UDraw scene - not written
,----------------------------------.
---( Adding a new Extension Controller )---
`----------------------------------'
//! I'll finish this when I write the UDraw code
Create a new Extension Controller called "mydev"
Create wii_ec_mydev.c and wii_ec_mydev.h
In wii_ec_mydev.c|h
Create the functions [& prototypes]
bool mydev_init (wiiEC_t* const) ; // Additional initialisation code
void mydev_decode (wiiEC_t* const) ; // Decode controller input data
void mydev_msg (wiiEC_t* const, FuriMessageQueue* const) ; // Put event messages in the event queue
void mydev_calib (wiiEC_t* const, ecCalib_t) ; // Controller calibration function
void mydev_show (Canvas* const, state_t* const) ; // Scene LCD display
bool mydev_key (const eventMsg_t* const, state_t* const) ; // Scene key controls
In wii_ec.h
Include the new header
#include "wii_ec_mydev.h"
Add a perhipheral id to enum ecPid
PID_MYDEV
In wii_anal.h
As a scene name to enum scene
SCENE_MYDEV
In wii_ec.c
Add the device definition to the ecId[] array
[PID_MYDEV] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, "My Device", SCENE_MYDEV,
mydev_init, mydev_decode, mydev_msg, mydev_calib, mydev_show, mydev_key },