Skip to content

Instantly share code, notes, and snippets.

@pamaury
pamaury / partial_work.diff
Created July 12, 2013 11:56
Incomplete work to merge driver into our codebase: use rockbox defines, drop usb_instance, use global config, partially implement target functions. Probably doesn't compile
diff --git a/firmware/target/arm/synopsysotg.c b/firmware/target/arm/synopsysotg.c
index 6fc620d..8d2d73e 100644
--- a/firmware/target/arm/synopsysotg.c
+++ b/firmware/target/arm/synopsysotg.c
@@ -1,8 +1,7 @@
-#include "global.h"
-#include "core/synopsysotg/synopsysotg.h"
-#include "protocol/usb/usb.h"
-#include "sys/time.h"
-#include "sys/util.h"
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
index 1474e06..4ef17b5 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
@@ -200,11 +200,16 @@ static struct button_area_t button_areas[] =
#define RMI_INTERRUPT 1
#define RMI_SET_SENSITIVITY 2
+#define RMI_SET_SLEEP_MODE 3
+
static unsigned char dev_ctl_reg;
void rmi_init(/*...*/)
{
/* ... */
dev_ctl_reg = rmi_read_single(RMI_DEVICE_CONTROL);
}
void rmi_set_sleep_mode(int mode)
{
@pamaury
pamaury / touchpad.c
Last active December 20, 2015 08:49
/* first init power somewhere */
sleep_mode = rmi_get_sleep_mode();
if(btns & BUTTON_VOL_UP)
if(sleep_mode < RMI_SLEEP_MODE_FULLY_AWAKE)
sleep_mode++;
if(btns & BUTTON_VOL_DONW)
if(sleep_mode > RMI_SLEEP_MODE_SLEEP)
sleep_mode--;
rmi_set_sleep_mode(sleep_mode);
void lcdif_schedule_continuous_refresh(void *buffer, unsigned w, unsigned h)
{
logf("refresh %dx%d\n", w, h);
lcdif_write_reg(0x36, w - 1);
lcdif_write_reg(0x37, 0);
lcdif_write_reg(0x38, h - 1);
lcdif_write_reg(0x39, 0);
lcdif_write_reg(0x20, 0);
lcdif_write_reg(0x21, 0);
--[[
Fuze+ 2.36.8 hacking
required argument (in order):
- path to firmware
]]--
if #arg < 2 then
error("not enough argument to fuzep patcher")
end
--[[
Fuze+ RB hacking
required argument (in order):
- path to firmware
- path to output firmware
- path to blob
]]--
if #arg < 3 then
error("not enough argument to fuzep patcher")
diff --git a/apps/action.c b/apps/action.c
index 2492a7d..f71b03d 100644
--- a/apps/action.c
+++ b/apps/action.c
@@ -294,6 +294,10 @@ static int get_action_worker(int context, int timeout,
{
last_button = BUTTON_NONE;
keys_locked = false;
+#if defined(HAVE_TOUCHPAD) || defined(HAVE_TOUCHSCREEN)
+ /* enable back touch device */
diff --git a/utils/hwstub/hwstub_protocol.h b/utils/hwstub/hwstub_protocol.h
index 99131aa..33c61dd 100644
--- a/utils/hwstub/hwstub_protocol.h
+++ b/utils/hwstub/hwstub_protocol.h
@@ -101,6 +101,7 @@ struct usb_resp_info_features_t
#define HWSTUB_TARGET_UNK ('U' | 'N' << 8 | 'K' << 16 | ' ' << 24)
#define HWSTUB_TARGET_STMP ('S' | 'T' << 8 | 'M' << 16 | 'P' << 24)
+#define HWSTUB_TARGET_RKNANO ('R' | 'K' << 8 | 'N' << 16 | 'A' << 24)
@pamaury
pamaury / rb_atj_crypt.c
Last active December 27, 2015 16:19
ATJ first stage bootloader scrambler, mostly
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
unsigned char xor_key[512] =
{
0x9b, 0x94, 0xf6, 0x9e, 0x2f, 0x0a, 0x40, 0xfd, 0x9a, 0x78, 0x2c, 0xdd, 0x4f, 0x96, 0x5e, 0xdd,
0xc9, 0x01, 0xd3, 0x9d, 0x71, 0x8f, 0xda, 0xbb, 0xc1, 0xdf, 0x5f, 0x01, 0xaa, 0x35, 0x6f, 0xdc,
0x33, 0x85, 0xf9, 0x10, 0x64, 0xce, 0xd2, 0xab, 0x62, 0xaa, 0xfc, 0x37, 0xdb, 0x22, 0x28, 0x34,