* @brief Volume Memory.
*/
typedef struct {
- int32_t left; /**< Left. */
- int32_t right; /**< Right. */
+ uint32_t left; /**< Left. */
+ uint32_t right; /**< Right. */
} volume_t;
static volume_t volume;
-/*
- * See 'Blackfin GCC Built-in Functions'
- */
-
static void effect_through(
UZUME *p,
const int32_t *src, int32_t *des, int32_t count)
UZUME *p,
const int32_t *src, int32_t *des, int32_t count)
{
- int32_t vl, vr;
int i;
volume.left = 0;
volume.right = 0;
/*
* Volume.
*/
- vl = *(des + i + 0);
- vr = *(des + i + 1);
- if (vl < 0) { vl = -vl; }
- if (vr < 0) { vr = -vr; }
- volume.left += vl >> 1;
- volume.right += vr >> 1;
+ volume.left += abs(*(des + i + 0)) >> 1;
+ volume.right += abs(*(des + i + 1)) >> 1;
}
}
static void system_default(UZUME *p)
{
- int32_t vl = volume.left;
- int32_t vr = volume.right;
- vl = ((uint32_t)vl) >> 29;
- vr = ((uint32_t)vr) >> 29;
+ uint32_t vl = volume.left >> 29;
+ uint32_t vr = volume.right >> 29;
lcd_goto(0, 0);
lcd_putc(0x08 + vl);
lcd_putc(0x08 + vr);