mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
Merge functionality of wakeups and semaphores-- fewer APIs and object types. semaphore_wait takes a timeout now so codecs and plugins have to be made incompatible. Don't make semaphores for targets not using them.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29492 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
05e180a130
commit
12375d1d3a
38 changed files with 294 additions and 311 deletions
|
|
@ -42,11 +42,11 @@
|
|||
|
||||
|
||||
static struct mutex adc_mtx;
|
||||
static struct wakeup adc_wakeup;
|
||||
static struct semaphore adc_wakeup;
|
||||
|
||||
void INT_ADC(void)
|
||||
{
|
||||
wakeup_signal(&adc_wakeup);
|
||||
semaphore_release(&adc_wakeup);
|
||||
}
|
||||
|
||||
unsigned short adc_read(int channel)
|
||||
|
|
@ -61,7 +61,7 @@ unsigned short adc_read(int channel)
|
|||
(1 << 0); /* enable start */
|
||||
|
||||
/* wait for conversion */
|
||||
wakeup_wait(&adc_wakeup, TIMEOUT_BLOCK);
|
||||
semaphore_wait(&adc_wakeup, TIMEOUT_BLOCK);
|
||||
|
||||
/* get the converted data */
|
||||
data = ADCDAT0 & 0x3FF;
|
||||
|
|
@ -77,7 +77,7 @@ unsigned short adc_read(int channel)
|
|||
void adc_init(void)
|
||||
{
|
||||
mutex_init(&adc_mtx);
|
||||
wakeup_init(&adc_wakeup);
|
||||
semaphore_init(&adc_wakeup, 1, 0);
|
||||
|
||||
/* enable clock to ADC */
|
||||
PWRCON &= ~(1 << 10);
|
||||
|
|
|
|||
|
|
@ -94,9 +94,9 @@ static long nand_last_activity_value = -1;
|
|||
static long nand_stack[DEFAULT_STACK_SIZE];
|
||||
|
||||
static struct mutex nand_mtx;
|
||||
static struct wakeup nand_wakeup;
|
||||
static struct semaphore nand_complete;
|
||||
static struct mutex ecc_mtx;
|
||||
static struct wakeup ecc_wakeup;
|
||||
static struct semaphore ecc_complete;
|
||||
|
||||
static uint8_t nand_data[0x800] STORAGE_ALIGN_ATTR;
|
||||
static uint8_t nand_ctrl[0x200] STORAGE_ALIGN_ATTR;
|
||||
|
|
@ -731,9 +731,9 @@ static void nand_thread(void)
|
|||
int nand_device_init(void)
|
||||
{
|
||||
mutex_init(&nand_mtx);
|
||||
wakeup_init(&nand_wakeup);
|
||||
semaphore_init(&nand_complete, 1, 0);
|
||||
mutex_init(&ecc_mtx);
|
||||
wakeup_init(&ecc_wakeup);
|
||||
semaphore_init(&ecc_complete, 1, 0);
|
||||
|
||||
uint32_t type;
|
||||
uint32_t i, j;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue