forked from PAWPAW-Mirror/lib_xua
Make functions static where possible, no intended functionality change.
This saves 208 bytes.
This commit is contained in:
@@ -357,7 +357,7 @@ int DFUReportResetState(chanend ?c_user_cmd)
|
||||
return inDFU;
|
||||
}
|
||||
|
||||
int XMOS_DFU_RevertFactory(chanend ?c_user_cmd)
|
||||
static int XMOS_DFU_RevertFactory(chanend ?c_user_cmd)
|
||||
{
|
||||
unsigned s = 0;
|
||||
|
||||
@@ -371,7 +371,7 @@ int XMOS_DFU_RevertFactory(chanend ?c_user_cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int XMOS_DFU_SelectImage(unsigned int index, chanend ?c_user_cmd)
|
||||
static int XMOS_DFU_SelectImage(unsigned int index, chanend ?c_user_cmd)
|
||||
{
|
||||
// Select the image index for firmware update
|
||||
// Currently not used or implemented
|
||||
@@ -379,12 +379,12 @@ int XMOS_DFU_SelectImage(unsigned int index, chanend ?c_user_cmd)
|
||||
}
|
||||
|
||||
|
||||
int XMOS_DFU_SaveState()
|
||||
static int XMOS_DFU_SaveState()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int XMOS_DFU_LoadState()
|
||||
static int XMOS_DFU_LoadState()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ static inline void doI2SClocks(unsigned divide)
|
||||
|
||||
/* I2S delivery thread */
|
||||
#pragma unsafe arrays
|
||||
{unsigned, unsigned} deliver(chanend c_out, chanend ?c_spd_out, unsigned divide, unsigned curSamFreq, chanend ?c_dig_rx, chanend ?c_adc)
|
||||
{unsigned, unsigned} static deliver(chanend c_out, chanend ?c_spd_out, unsigned divide, unsigned curSamFreq, chanend ?c_dig_rx, chanend ?c_adc)
|
||||
{
|
||||
unsigned sample;
|
||||
unsigned underflow = 0;
|
||||
@@ -711,7 +711,7 @@ static inline void doI2SClocks(unsigned divide)
|
||||
|
||||
/* This function is a dummy version of the deliver thread that does not
|
||||
connect to the codec ports. It is used during DFU reset. */
|
||||
{unsigned,unsigned} dummy_deliver(chanend c_out)
|
||||
{unsigned,unsigned} static dummy_deliver(chanend c_out)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
|
||||
@@ -38,13 +38,13 @@ static int clockValid[NUM_CLOCKS]; /* Store current val
|
||||
static int clockInt[NUM_CLOCKS]; /* Interupt flag for clocks */
|
||||
static int clockId[NUM_CLOCKS];
|
||||
|
||||
int abs(int x)
|
||||
static int abs(int x)
|
||||
{
|
||||
if (x < 0) return -x;
|
||||
return x;
|
||||
}
|
||||
|
||||
int channelContainsControlToken(chanend x)
|
||||
static int channelContainsControlToken(chanend x)
|
||||
{
|
||||
unsigned char tmpc;
|
||||
|
||||
@@ -58,7 +58,7 @@ int channelContainsControlToken(chanend x)
|
||||
|
||||
}
|
||||
|
||||
void outInterrupt(chanend c_interruptControl, int value)
|
||||
static void outInterrupt(chanend c_interruptControl, int value)
|
||||
{
|
||||
/* Non-blocking check for control token */
|
||||
//if (channelContainsControlToken(c_interruptControl))
|
||||
|
||||
@@ -54,7 +54,7 @@ unsigned int g_curSamFreq48000Family = DEFAULT_FREQ % 48000 == 0;
|
||||
unsigned int g_curSamFreqMultiplier = DEFAULT_FREQ / 48000;
|
||||
|
||||
/* Store an int into a char array: Note this allows non-word aligned access unlike reinerpret cast */
|
||||
void storeInt(unsigned char buffer[], int index, int val)
|
||||
static void storeInt(unsigned char buffer[], int index, int val)
|
||||
{
|
||||
buffer[index+3] = val>>24;
|
||||
buffer[index+2] = val>>16;
|
||||
@@ -63,13 +63,13 @@ void storeInt(unsigned char buffer[], int index, int val)
|
||||
}
|
||||
|
||||
/* Store an short into a char array: Note this allows non-word aligned access unlike reinerpret cast */
|
||||
void storeShort(unsigned char buffer[], int index, short val)
|
||||
static void storeShort(unsigned char buffer[], int index, short val)
|
||||
{
|
||||
buffer[index+1] = val>>8;
|
||||
buffer[index] = val;
|
||||
}
|
||||
|
||||
void storeFreq(unsigned char buffer[], int &i, int freq)
|
||||
static void storeFreq(unsigned char buffer[], int &i, int freq)
|
||||
{
|
||||
storeInt(buffer, i, freq);
|
||||
i+=4;
|
||||
@@ -81,7 +81,7 @@ void storeFreq(unsigned char buffer[], int &i, int freq)
|
||||
}
|
||||
|
||||
|
||||
unsigned longMul(unsigned a, unsigned b, int prec)
|
||||
static unsigned longMul(unsigned a, unsigned b, int prec)
|
||||
{
|
||||
unsigned x,y;
|
||||
unsigned ret;
|
||||
@@ -94,12 +94,12 @@ unsigned longMul(unsigned a, unsigned b, int prec)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void setG_curSamFreqMultiplier(int x) {
|
||||
static void setG_curSamFreqMultiplier(int x) {
|
||||
asm(" stw %0, dp[g_curSamFreqMultiplier]" :: "r"(x));
|
||||
}
|
||||
|
||||
/* Update master volume i.e. i.e update weights for all channels */
|
||||
void updateMasterVol( int unitID, chanend ?c_mix_ctl)
|
||||
static void updateMasterVol( int unitID, chanend ?c_mix_ctl)
|
||||
{
|
||||
int x;
|
||||
#ifndef OUT_VOLUME_IN_MIXER
|
||||
@@ -168,7 +168,7 @@ void updateMasterVol( int unitID, chanend ?c_mix_ctl)
|
||||
}
|
||||
}
|
||||
|
||||
void updateVol(int unitID, int channel, chanend ?c_mix_ctl)
|
||||
static void updateVol(int unitID, int channel, chanend ?c_mix_ctl)
|
||||
{
|
||||
int x;
|
||||
#ifndef OUT_VOLUME_IN_MIXER
|
||||
|
||||
@@ -115,7 +115,7 @@ int doMix8(xc_ptr samples, xc_ptr mult);
|
||||
/* DO NOT inline, causes 10.4.2 tools to add extra loads in loop */
|
||||
/* At 18 x 12dB we could get 64 x bigger */
|
||||
#pragma unsafe arrays
|
||||
int doMix(xc_ptr samples, xc_ptr ptr, xc_ptr mult)
|
||||
static int doMix(xc_ptr samples, xc_ptr ptr, xc_ptr mult)
|
||||
{
|
||||
int h=0;
|
||||
int l=0;
|
||||
@@ -151,7 +151,7 @@ int doMix(xc_ptr samples, xc_ptr ptr, xc_ptr mult)
|
||||
#endif
|
||||
|
||||
#pragma unsafe arrays
|
||||
void giveSamplesToHost(chanend c, xc_ptr samples, xc_ptr ptr, xc_ptr multIn)
|
||||
static void giveSamplesToHost(chanend c, xc_ptr samples, xc_ptr ptr, xc_ptr multIn)
|
||||
{
|
||||
#if defined(IN_VOLUME_IN_MIXER) && defined(IN_VOLUME_AFTER_MIX)
|
||||
int mult;
|
||||
@@ -220,7 +220,7 @@ static void getSamplesFromHost(chanend c, xc_ptr samples, int base)
|
||||
}
|
||||
|
||||
#pragma unsafe arrays
|
||||
void giveSamplesToDevice(chanend c, xc_ptr samples, xc_ptr ptr, xc_ptr multOut)
|
||||
static void giveSamplesToDevice(chanend c, xc_ptr samples, xc_ptr ptr, xc_ptr multOut)
|
||||
{
|
||||
#pragma loop unroll
|
||||
for (int i=0;i<NUM_USB_CHAN_OUT;i++)
|
||||
@@ -248,7 +248,7 @@ void giveSamplesToDevice(chanend c, xc_ptr samples, xc_ptr ptr, xc_ptr multOut)
|
||||
}
|
||||
|
||||
#pragma unsafe arrays
|
||||
void getSamplesFromDevice(chanend c, xc_ptr samples, int base)
|
||||
static void getSamplesFromDevice(chanend c, xc_ptr samples, int base)
|
||||
{
|
||||
#if defined(IN_VOLUME_IN_MIXER) && !defined(IN_VOLUME_AFTER_MIX)
|
||||
int mult;
|
||||
@@ -281,10 +281,10 @@ void getSamplesFromDevice(chanend c, xc_ptr samples, int base)
|
||||
}
|
||||
}
|
||||
|
||||
int mixer1_mix2_flag = (DEFAULT_FREQ > 96000);
|
||||
static int mixer1_mix2_flag = (DEFAULT_FREQ > 96000);
|
||||
|
||||
#pragma unsafe arrays
|
||||
void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2)
|
||||
static void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2)
|
||||
{
|
||||
int mixed;
|
||||
unsigned cmd;
|
||||
@@ -515,10 +515,10 @@ void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2)
|
||||
}
|
||||
}
|
||||
|
||||
int mixer2_mix2_flag = (DEFAULT_FREQ > 96000);
|
||||
static int mixer2_mix2_flag = (DEFAULT_FREQ > 96000);
|
||||
|
||||
#pragma unsafe arrays
|
||||
void mixer2(chanend c_mixer1, chanend c_audio)
|
||||
static void mixer2(chanend c_mixer1, chanend c_audio)
|
||||
{
|
||||
int mixed;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ int slotSize = 3; /* 3 bytes per sample for Audio Class 1.0 */
|
||||
|
||||
#pragma select handler
|
||||
#pragma unsafe arrays
|
||||
void handle_audio_request(chanend c_mix_out)
|
||||
void handle_audio_request(chanend c_mix_out)
|
||||
{
|
||||
int outSamps;
|
||||
int space_left;
|
||||
@@ -472,7 +472,7 @@ unsigned g_intFlag = 0;
|
||||
|
||||
extern unsigned char g_intData[8];
|
||||
|
||||
void check_for_interrupt(chanend ?c_clk_int) {
|
||||
static void check_for_interrupt(chanend ?c_clk_int) {
|
||||
unsigned tmp;
|
||||
|
||||
select
|
||||
|
||||
@@ -42,7 +42,7 @@ void reset_midi_state(struct midi_in_parse_state &mips) {
|
||||
* @brief Construct USB MIDI event
|
||||
*
|
||||
*/
|
||||
unsigned makeEvent(unsigned cable_number, unsigned codeIndexNumber, unsigned midi0, unsigned midi1, unsigned midi2) {
|
||||
static unsigned makeEvent(unsigned cable_number, unsigned codeIndexNumber, unsigned midi0, unsigned midi1, unsigned midi2) {
|
||||
unsigned event = (cable_number << 28);
|
||||
event |= (codeIndexNumber << 24);
|
||||
event |= (midi0 << 16);
|
||||
|
||||
Reference in New Issue
Block a user