forked from len0rd/rockbox
Revert "Introduce plugin_crt0.c that every plugin links."
Too much errors and no time to fix them now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27863 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
abdc5935be
commit
93cb949372
142 changed files with 341 additions and 372 deletions
|
|
@ -20,9 +20,8 @@
|
|||
****************************************************************************/
|
||||
#include "plugin.h"
|
||||
#include "lib/pluginlib_actions.h"
|
||||
#include "lib/pluginlib_exit.h"
|
||||
|
||||
|
||||
PLUGIN_HEADER
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
/* tick sound from a metronome */
|
||||
|
|
@ -847,14 +846,13 @@ void timer_callback(void)
|
|||
}
|
||||
}
|
||||
|
||||
void cleanup(void)
|
||||
void cleanup(void *parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
|
||||
rb->timer_unregister();
|
||||
MET_PLAY_STOP; /* stop audio ISR */
|
||||
rb->led(0);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tap(void)
|
||||
|
|
@ -887,9 +885,9 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
{
|
||||
int button;
|
||||
static int last_button = BUTTON_NONE;
|
||||
enum plugin_status status;
|
||||
|
||||
(void)parameter;
|
||||
atexit(cleanup);
|
||||
|
||||
if (MET_IS_PLAYING)
|
||||
MET_PLAY_STOP; /* stop audio IS */
|
||||
|
|
@ -929,7 +927,9 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
|
||||
case METRONOME_QUIT:
|
||||
/* get out of here */
|
||||
return PLUGIN_OK;
|
||||
cleanup(NULL);
|
||||
status = PLUGIN_OK;
|
||||
goto metronome_exit;
|
||||
|
||||
case METRONOME_PAUSE:
|
||||
if(!sound_paused)
|
||||
|
|
@ -981,7 +981,12 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
#endif
|
||||
|
||||
default:
|
||||
exit_on_usb(button);
|
||||
if (rb->default_event_handler_ex(button, cleanup, NULL)
|
||||
== SYS_USB_CONNECTED)
|
||||
{
|
||||
status = PLUGIN_USB_CONNECTED;
|
||||
goto metronome_exit;
|
||||
}
|
||||
reset_tap = false;
|
||||
break;
|
||||
|
||||
|
|
@ -993,5 +998,11 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
}
|
||||
rb->yield();
|
||||
}
|
||||
|
||||
metronome_exit:
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
|
||||
#endif
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue