Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  ADC_read to plugin API
« previous next »
  • Print
Pages: [1]

Author Topic: ADC_read to plugin API  (Read 1741 times)

Offline Angyman

  • Member
  • *
  • Posts: 54
ADC_read to plugin API
« on: November 04, 2007, 04:21:23 PM »
Hi everybody. For testing purposes i would like to get the adc_scan() or adc_read() into the plugin api. I tried it by including the necessary stuff in the plugin.c and plugin.h files as followed (Last try was to do that by including adc.h instead of adc-target.h"

The problem is that the adc readout seems to stop sending values after the very first one. I did the same procedure half a year ago and had no problems with that.

Any advice what could be my mistake?

Code: [Select]
smoothadc.c (plugin):
-----------------------
...
    while (true)
    {
        rb->sleep(1);
        rb->lcd_clear_display();

/* Only do this if no pause*/
if (pause == false)
{
data = rb->adc_read(ADC_SCROLLPAD);
}

rb->snprintf(str, sizeof(str), "ADC: %x", data);
rb->lcd_puts(0, 0 ,str);
    }
...

plugin.c
------------------------
#include "adc.h"
...
static const struct plugin_api rockbox_api = {
...
adc_read,
}

plugin.h
------------------------
#include "adc.h"
...
struct plugin_api {
...
unsigned short (*adc_read)(int channel);
}
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  ADC_read to plugin API
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.044 seconds with 15 queries.