Skip to content

Instantly share code, notes, and snippets.

@pamaury
Created July 27, 2013 16:39
Show Gist options
  • Save pamaury/6095412 to your computer and use it in GitHub Desktop.
Save pamaury/6095412 to your computer and use it in GitHub Desktop.
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)
{
if((dev_ctl_reg & 7) != mode)
{
dev_ctl_reg = (dev_ctl_reg & ~7) | mode;
rmi_write_single(RMI_DEVICE_CONTROL, dev_ctl_reg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment