diff options
author | DaveHodder67 <dave.hodder@focusrite.com> | 2015-07-02 19:57:36 +0100 |
---|---|---|
committer | DaveHodder67 <dave.hodder@focusrite.com> | 2015-07-02 19:57:36 +0100 |
commit | 00c0e5746a9df029acfecaaa1f61a2c70d2b363c (patch) | |
tree | e75fff62016a8962eef956b63c06325509ea4b01 /README.md | |
parent | e1f9c0ada85d1538e08d5d51986bd4593f05ff9c (diff) | |
download | launchpad-polymaker-00c0e5746a9df029acfecaaa1f61a2c70d2b363c.tar.gz launchpad-polymaker-00c0e5746a9df029acfecaaa1f61a2c70d2b363c.zip |
simulator described in README
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -65,21 +65,27 @@ I won't describe how to use these tools, I'm sure you already know - and if you | |||
65 | Don't worry - even if you upload toxic nonsense to the device, you cannot brick it - the bootloader is stored in a protected area of flash. If your new firmware doesn't boot, you'll get stuck at step (3) above, or with a crashed unit. Simply repeat the above process with the shipping firmware image (resources/Launchpad Pro-1.0.154.syx) to restore your unit to the factory defaults. Better yet, fix the bugs :) | 65 | Don't worry - even if you upload toxic nonsense to the device, you cannot brick it - the bootloader is stored in a protected area of flash. If your new firmware doesn't boot, you'll get stuck at step (3) above, or with a crashed unit. Simply repeat the above process with the shipping firmware image (resources/Launchpad Pro-1.0.154.syx) to restore your unit to the factory defaults. Better yet, fix the bugs :) |
66 | 66 | ||
67 | # API | 67 | # API |
68 | The most crucial parts of the API are: | 68 | The API works in two directions - from the HAL (hardware abstraction layer) to the app, and from the app to the HAL. From the HAL you can: |
69 | 69 | ||
70 | - Receiving messages from the pads and buttons | 70 | - Receive messages from the pads and buttons |
71 | - Writing colours to the LEDs | 71 | - Receive messages from the MIDI/USB ports |
72 | - Sending and receiving messages from the MIDI ports | 72 | - Receive a tick message to drive timer based code |
73 | - Receiving a tick message to drive timer based code | ||
74 | 73 | ||
75 | The best way to learn about these is to read the documentation in app.h, and to study the example code! | 74 | To the HAL, your app can |
75 | |||
76 | - Write colours to the LEDs | ||
77 | - Send messages to the MIDI/USB ports | ||
78 | |||
79 | The best way to learn about these is to read the documentation in app.h, and to study the (very basic) example code! | ||
80 | |||
81 | Currently the HAL/app interface does not support reading or writing the flash memory. | ||
76 | 82 | ||
77 | # Debugging | 83 | # Debugging |
78 | We decided not to support or encourage using a hardware debugger, as opening a Launchpad Pro to fit a debugging header can easily damage the FSR (force sensitive resistor) sheet. | 84 | We decided not to support or encourage using a hardware debugger, as opening a Launchpad Pro to fit a debugging header can easily damage the FSR (force sensitive resistor) sheet. |
79 | 85 | ||
80 | Instead, you're going to have to do things the old fashioned way - by blinking LEDs or sending MIDI messages. FWIW, that's the way I've developed this version of the firmware - dogfooding all the way ;) | 86 | Instead, you're going to have to do things the old fashioned way - by blinking LEDs or sending MIDI messages. For what it's worth, that's the way I've developed this version of the firmware - dogfooding all the way ;) |
81 | 87 | ||
82 | If you want to test code in detail, we suggest developing it on a host. I want to develop a host app which presents the same API to app.c, but which forwards all messages to and from the hardware Launchpad Pro via MIDI - that way you'll be able to debug most code on the host very nicely. | 88 | If do you want to debug interactively (and of course you do), you can use the simple command-line simulator located in the `/tools` directory. It is compiled and ran as part of the build process, so it serves as a very basic test of your app before it is baked into a sysex dump. If you want to test particular button presses or MIDI messages, just modify it to send those messages to your app, and debug away. Yes, it's rudimental - wiring it up to the device over MIDI for interactive testing would be fab! |
83 | 89 | ||
84 | # Vagrant tips | 90 | # Vagrant tips |
85 | When you're done developing, simply type `vagrant suspend` to halt your VM without destroying it - this will make `vagrant up` a lot quicker next time. If you're really finished, `vagrant destroy` will completely remove the VM from your system (but not any of your code). | 91 | When you're done developing, simply type `vagrant suspend` to halt your VM without destroying it - this will make `vagrant up` a lot quicker next time. If you're really finished, `vagrant destroy` will completely remove the VM from your system (but not any of your code). |