From 18fa0c1ff2cd17dddb4eac7cfcb61a45c2ce1fdc Mon Sep 17 00:00:00 2001 From: tk Date: Wed, 20 Jan 2010 23:32:53 +0000 Subject: [PATCH] MBSIDV3: fixed some warnings --- apps/synthesizers/midibox_sid_v3/core/app.c | 2 +- apps/synthesizers/midibox_sid_v3/core/app.h | 4 ++++ apps/synthesizers/midibox_sid_v3/core/sid_asid.c | 4 ++-- apps/synthesizers/midibox_sid_v3/core/sid_midi_d.c | 1 + apps/synthesizers/midibox_sid_v3/core/sid_midi_m.c | 1 + apps/synthesizers/midibox_sid_v3/core/sid_par.c | 8 ++++---- apps/synthesizers/midibox_sid_v3/core/sid_se.c | 8 +++++++- apps/synthesizers/midibox_sid_v3/core/sid_se_b.c | 2 +- apps/synthesizers/midibox_sid_v3/core/sid_se_d.c | 3 --- apps/synthesizers/midibox_sid_v3/core/sid_se_m.c | 1 - apps/synthesizers/midibox_sid_v3/core/sid_sysex.c | 10 +++++----- apps/synthesizers/midibox_sid_v3/mios32/tasks.c | 1 + mios32/common/mios32_enc28j60.c | 3 ++- mios32/common/mios32_mf.c | 3 ++- mios32/common/mios32_sdcard.c | 4 ++-- modules/dosfs/dosfs.c | 13 +++++++------ modules/freertos_utils/freertos_utils.c | 6 ++++-- modules/midifile/mid_parser.c | 3 +++ modules/msd/msd_scsi.c | 8 ++++---- modules/sid/sid.c | 2 +- modules/sid/sid.mk | 2 -- 21 files changed, 52 insertions(+), 37 deletions(-) diff --git a/apps/synthesizers/midibox_sid_v3/core/app.c b/apps/synthesizers/midibox_sid_v3/core/app.c index 46231f705..c5f8c600d 100755 --- a/apps/synthesizers/midibox_sid_v3/core/app.c +++ b/apps/synthesizers/midibox_sid_v3/core/app.c @@ -209,7 +209,7 @@ void SID_TASK_Period1S(void) MUTEX_MIDIOUT_GIVE; static u8 wait_boot_ctr = 2; // wait 2 seconds before loading from SD Card - this is to increase the time where the boot screen is print! - u8 load_sd_content = 0; + //u8 load_sd_content = 0; // don't check for SD Card if MSD enabled if( TASK_MSD_EnableGet() > 0 ) diff --git a/apps/synthesizers/midibox_sid_v3/core/app.h b/apps/synthesizers/midibox_sid_v3/core/app.h index 7db07dc2b..4911d330e 100644 --- a/apps/synthesizers/midibox_sid_v3/core/app.h +++ b/apps/synthesizers/midibox_sid_v3/core/app.h @@ -39,6 +39,10 @@ extern void APP_ENC_NotifyChange(u32 encoder, s32 incrementer); extern void APP_AIN_NotifyChange(u32 pin, u32 pin_value); +extern void SID_TASK_Period1mS(void); +extern void SID_TASK_Period1mS_LowPrio(void); +extern void SID_TASK_Period1S(void); + extern s32 APP_StopwatchInit(void); extern s32 APP_StopwatchReset(void); extern s32 APP_StopwatchCapture(void); diff --git a/apps/synthesizers/midibox_sid_v3/core/sid_asid.c b/apps/synthesizers/midibox_sid_v3/core/sid_asid.c index 2adc498e9..df5ec3045 100644 --- a/apps/synthesizers/midibox_sid_v3/core/sid_asid.c +++ b/apps/synthesizers/midibox_sid_v3/core/sid_asid.c @@ -59,8 +59,8 @@ static mios32_midi_port_t asid_last_sysex_port; static u8 asid_cmd; static u8 asid_stream_ix; static u8 asid_reg_ix; -static asid_masks[4]; -static asid_msbs[4]; +static u8 asid_masks[4]; +static u8 asid_msbs[4]; static const u8 asid_reg_map[28] = { 0x00, 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0c, 0x0d, 0x0e, 0x0f, diff --git a/apps/synthesizers/midibox_sid_v3/core/sid_midi_d.c b/apps/synthesizers/midibox_sid_v3/core/sid_midi_d.c index 5d9968fbe..e223172c0 100644 --- a/apps/synthesizers/midibox_sid_v3/core/sid_midi_d.c +++ b/apps/synthesizers/midibox_sid_v3/core/sid_midi_d.c @@ -28,6 +28,7 @@ #include "sid_patch.h" #include "sid_knob.h" +#include "sid_par.h" diff --git a/apps/synthesizers/midibox_sid_v3/core/sid_midi_m.c b/apps/synthesizers/midibox_sid_v3/core/sid_midi_m.c index a25f2d9d9..919364ea4 100644 --- a/apps/synthesizers/midibox_sid_v3/core/sid_midi_m.c +++ b/apps/synthesizers/midibox_sid_v3/core/sid_midi_m.c @@ -28,6 +28,7 @@ #include "sid_patch.h" #include "sid_knob.h" +#include "sid_par.h" #include "sid_voice.h" diff --git a/apps/synthesizers/midibox_sid_v3/core/sid_par.c b/apps/synthesizers/midibox_sid_v3/core/sid_par.c index c4cb70509..161835945 100644 --- a/apps/synthesizers/midibox_sid_v3/core/sid_par.c +++ b/apps/synthesizers/midibox_sid_v3/core/sid_par.c @@ -32,7 +32,7 @@ ///////////////////////////////////////////////////////////////////////////// // local prototypes ///////////////////////////////////////////////////////////////////////////// -static SID_PAR_HlpNote(u8 sid, u8 value, u8 voice_sel); +static s32 SID_PAR_HlpNote(u8 sid, u8 value, u8 voice_sel); ///////////////////////////////////////////////////////////////////////////// @@ -1717,11 +1717,11 @@ s32 SID_PAR_Set(u8 sid, u8 par, u16 value, u8 sidlr, u8 ins) } break; case P_M_WT_6: { - patch->ALL[0x100 | item->addr_l] = (0x100 | patch->ALL[item->addr_l] & 0xc0) | (value & 0x3f); + patch->ALL[0x100 | item->addr_l] = (0x100 | (patch->ALL[item->addr_l] & 0xc0)) | (value & 0x3f); } break; case P_M_WT_7: { - patch->ALL[0x100 | item->addr_l] = (0x100 | patch->ALL[item->addr_l] & 0x80) | (value & 0x7f); + patch->ALL[0x100 | item->addr_l] = (0x100 | (patch->ALL[item->addr_l] & 0x80)) | (value & 0x7f); } break; case P_M_WT_POS: { @@ -1897,7 +1897,7 @@ s32 SID_PAR_Set(u8 sid, u8 par, u16 value, u8 sidlr, u8 ins) // help function to control a note -static SID_PAR_HlpNote(u8 sid, u8 value, u8 voice_sel) +static s32 SID_PAR_HlpNote(u8 sid, u8 value, u8 voice_sel) { int i; diff --git a/apps/synthesizers/midibox_sid_v3/core/sid_se.c b/apps/synthesizers/midibox_sid_v3/core/sid_se.c index a6dd4626c..3204a6a98 100644 --- a/apps/synthesizers/midibox_sid_v3/core/sid_se.c +++ b/apps/synthesizers/midibox_sid_v3/core/sid_se.c @@ -21,6 +21,8 @@ #include #include +#include "app.h" + #include "sid_se.h" #include "sid_se_l.h" #include "sid_se_b.h" @@ -159,6 +161,10 @@ s32 SID_SE_InitStructs(u8 sid) case SID_SE_MULTI: mv->midi_channel = midi_voice; + + case SID_SE_LEAD: + case SID_SE_DRUM: + break; // not relevant } } @@ -1064,7 +1070,7 @@ s32 SID_SE_Gate(sid_se_voice_t *v) switch( v->engine ) { case SID_SE_LEAD: { u8 osc_phase; - if( osc_phase=sid_patch[v->sid].L.osc_phase ) { + if( (osc_phase=sid_patch[v->sid].L.osc_phase) ) { // notify that OSC synchronisation has been started v->state.OSC_SYNC_IN_PROGRESS = 1; // set test flag for one update cycle diff --git a/apps/synthesizers/midibox_sid_v3/core/sid_se_b.c b/apps/synthesizers/midibox_sid_v3/core/sid_se_b.c index 0f588b0c4..d141fae85 100644 --- a/apps/synthesizers/midibox_sid_v3/core/sid_se_b.c +++ b/apps/synthesizers/midibox_sid_v3/core/sid_se_b.c @@ -23,6 +23,7 @@ #include "sid_se.h" #include "sid_se_b.h" #include "sid_patch.h" +#include "sid_par.h" ///////////////////////////////////////////////////////////////////////////// @@ -45,7 +46,6 @@ static s32 SID_SE_B_Seq(sid_se_seq_t *s); s32 SID_SE_B_Update(u8 sid) { int i; - sid_se_vars_t *vars = &sid_se_vars[sid]; /////////////////////////////////////////////////////////////////////////// diff --git a/apps/synthesizers/midibox_sid_v3/core/sid_se_d.c b/apps/synthesizers/midibox_sid_v3/core/sid_se_d.c index 5f59b31a0..1974be7c7 100644 --- a/apps/synthesizers/midibox_sid_v3/core/sid_se_d.c +++ b/apps/synthesizers/midibox_sid_v3/core/sid_se_d.c @@ -49,7 +49,6 @@ static s32 SID_SE_D_Seq(sid_se_seq_t *s); s32 SID_SE_D_Update(u8 sid) { int i; - sid_se_vars_t *vars = &sid_se_vars[sid]; /////////////////////////////////////////////////////////////////////////// @@ -432,8 +431,6 @@ static s32 SID_SE_D_Seq(sid_se_seq_t *s) ///////////////////////////////////////////////////////////////////////////// s32 SID_SE_D_NoteOn(u8 sid, u8 drum, u8 velocity) { - int i; - if( drum >= 16 ) return -1; // unsupported drum diff --git a/apps/synthesizers/midibox_sid_v3/core/sid_se_m.c b/apps/synthesizers/midibox_sid_v3/core/sid_se_m.c index 6bc55f64e..ee4197e18 100644 --- a/apps/synthesizers/midibox_sid_v3/core/sid_se_m.c +++ b/apps/synthesizers/midibox_sid_v3/core/sid_se_m.c @@ -38,7 +38,6 @@ s32 SID_SE_M_Update(u8 sid) { int i; - sid_se_vars_t *vars = &sid_se_vars[sid]; /////////////////////////////////////////////////////////////////////////// diff --git a/apps/synthesizers/midibox_sid_v3/core/sid_sysex.c b/apps/synthesizers/midibox_sid_v3/core/sid_sysex.c index 772cfa487..0db5433d3 100644 --- a/apps/synthesizers/midibox_sid_v3/core/sid_sysex.c +++ b/apps/synthesizers/midibox_sid_v3/core/sid_sysex.c @@ -327,8 +327,8 @@ static s32 SID_SYSEX_Cmd_PatchRead(mios32_midi_port_t port, sysex_cmd_state_t cm ///////////////////////////////////////////////////////////////////////////// static s32 SID_SYSEX_Cmd_PatchWrite(mios32_midi_port_t port, sysex_cmd_state_t cmd_state, u8 midi_in) { - static buffer_ix = 0; - static buffer_ix_max = 0; + static int buffer_ix = 0; + static int buffer_ix_max = 0; switch( cmd_state ) { @@ -413,7 +413,7 @@ static s32 SID_SYSEX_Cmd_ParWrite(mios32_midi_port_t port, sysex_cmd_state_t cmd { static u16 addr = 0; static u8 data = 0; - static u8 write_status = 0; + static s32 write_status = 0; switch( cmd_state ) { @@ -484,8 +484,8 @@ static s32 SID_SYSEX_Cmd_ParWrite(mios32_midi_port_t port, sysex_cmd_state_t cmd ///////////////////////////////////////////////////////////////////////////// static s32 SID_SYSEX_Cmd_Extra(mios32_midi_port_t port, sysex_cmd_state_t cmd_state, u8 midi_in) { - static extra_cmd = 0; - static play_instrument = 0; + static int extra_cmd = 0; + static int play_instrument = 0; switch( cmd_state ) { diff --git a/apps/synthesizers/midibox_sid_v3/mios32/tasks.c b/apps/synthesizers/midibox_sid_v3/mios32/tasks.c index 7816fe23a..3f424c835 100755 --- a/apps/synthesizers/midibox_sid_v3/mios32/tasks.c +++ b/apps/synthesizers/midibox_sid_v3/mios32/tasks.c @@ -20,6 +20,7 @@ #include +#include "app.h" #include "tasks.h" diff --git a/mios32/common/mios32_enc28j60.c b/mios32/common/mios32_enc28j60.c index b77aa8393..101eb42cd 100644 --- a/mios32/common/mios32_enc28j60.c +++ b/mios32/common/mios32_enc28j60.c @@ -567,6 +567,7 @@ s32 MIOS32_ENC28J60_PackageReceive(u8 *buffer, u16 buffer_size) { s32 status = 0; s32 package_count; + u16 packet_len = 0; MIOS32_ENC28J60_MUTEX_TAKE; @@ -633,7 +634,7 @@ s32 MIOS32_ENC28J60_PackageReceive(u8 *buffer, u16 buffer_size) WasDiscarded = 0; // empty package or CRC/symbol errors? - u16 packet_len = header.StatusVector.bits.ByteCount; + packet_len = header.StatusVector.bits.ByteCount; if( !packet_len || header.StatusVector.bits.CRCError || !header.StatusVector.bits.ReceiveOk ) { status = MIOS32_ENC28J60_MACDiscardRx(); // discard package immediately status = (status < 0) ? status : 0; diff --git a/mios32/common/mios32_mf.c b/mios32/common/mios32_mf.c index 26130cb31..c93d86a7c 100644 --- a/mios32/common/mios32_mf.c +++ b/mios32/common/mios32_mf.c @@ -308,7 +308,8 @@ mios32_mf_config_t MIOS32_MF_ConfigGet(u32 mf) { #if !MIOS32_MF_NUM // return 0; // doesn't work :-/ - // no motors + const mios32_mf_config_t dummy = { .cfg.deadband=3, .cfg.pwm_period=3, .cfg.pwm_duty_cycle_up=1, .cfg.pwm_duty_cycle_down=1 }; + return dummy; #else // MF number valid? if( mf >= MIOS32_MF_NUM ) { diff --git a/mios32/common/mios32_sdcard.c b/mios32/common/mios32_sdcard.c index 7e498328a..92d8ff116 100644 --- a/mios32/common/mios32_sdcard.c +++ b/mios32/common/mios32_sdcard.c @@ -136,7 +136,7 @@ s32 MIOS32_SDCARD_Init(u32 mode) s32 MIOS32_SDCARD_PowerOn(void) { s32 status; - int i,j; + int i; MIOS32_SDCARD_MUTEX_TAKE; // ensure that chip select line deactivated @@ -301,7 +301,7 @@ s32 MIOS32_SDCARD_CheckAvailable(u8 was_available) MIOS32_SPI_RC_PinSet(MIOS32_SDCARD_SPI, MIOS32_SDCARD_SPI_RC_PIN, 0); // spi, rc_pin, pin_value // send CMD0 to reset the media - if( ret=(MIOS32_SDCARD_SendSDCCmd(SDCMD_GO_IDLE_STATE, 0, SDCMD_GO_IDLE_STATE_CRC)) < 0 ) + if( (ret=(MIOS32_SDCARD_SendSDCCmd(SDCMD_GO_IDLE_STATE, 0, SDCMD_GO_IDLE_STATE_CRC))) < 0 ) goto not_available; // deactivate chip select diff --git a/modules/dosfs/dosfs.c b/modules/dosfs/dosfs.c index 4bcacc6a1..461c8b073 100755 --- a/modules/dosfs/dosfs.c +++ b/modules/dosfs/dosfs.c @@ -317,7 +317,7 @@ uint32_t DFS_SetFAT(PVOLINFO volinfo, uint8_t *scratch, uint32_t *scratchcache, // Odd cluster: High 12 bits being set if (cluster & 1) { - scratch[offset] = (scratch[offset] & 0x0f) | new_contents & 0xf0; + scratch[offset] = (scratch[offset] & 0x0f) | (new_contents & 0xf0); } // Even cluster: Low 12 bits being set else { @@ -331,7 +331,8 @@ uint32_t DFS_SetFAT(PVOLINFO volinfo, uint8_t *scratch, uint32_t *scratchcache, // If we wrote that sector OK, then read in the subsequent sector // and poke the first byte with the remainder of this FAT entry. if (DFS_OK == result) { - *scratchcache++; + // *scratchcache++; + ++*scratchcache; // TK: to avoid warning "value computed is not used" result = DFS_ReadSector(volinfo->unit, scratch, *scratchcache, 1); if (DFS_OK == result) { // Odd cluster: High 12 bits being set @@ -340,7 +341,7 @@ uint32_t DFS_SetFAT(PVOLINFO volinfo, uint8_t *scratch, uint32_t *scratchcache, } // Even cluster: Low 12 bits being set else { - scratch[0] = (scratch[0] & 0xf0) | new_contents & 0x0f; + scratch[0] = (scratch[0] & 0xf0) | (new_contents & 0x0f); } result = DFS_WriteSector(volinfo->unit, scratch, *scratchcache, 1); // mirror the FAT into copy 2 @@ -360,13 +361,13 @@ uint32_t DFS_SetFAT(PVOLINFO volinfo, uint8_t *scratch, uint32_t *scratchcache, else { // Odd cluster: High 12 bits being set if (cluster & 1) { - scratch[offset] = (scratch[offset] & 0x0f) | new_contents & 0xf0; + scratch[offset] = (scratch[offset] & 0x0f) | (new_contents & 0xf0); scratch[offset+1] = new_contents & 0xff00; } // Even cluster: Low 12 bits being set else { scratch[offset] = new_contents & 0xff; - scratch[offset+1] = (scratch[offset+1] & 0xf0) | new_contents & 0x0f; + scratch[offset+1] = (scratch[offset+1] & 0xf0) | (new_contents & 0x0f); } result = DFS_WriteSector(volinfo->unit, scratch, *scratchcache, 1); // mirror the FAT into copy 2 @@ -1093,7 +1094,7 @@ void DFS_Seek(PFILEINFO fileinfo, uint32_t offset, uint8_t *scratch) */ uint32_t DFS_UnlinkFile(PVOLINFO volinfo, uint8_t *path, uint8_t *scratch) { - PDIRENT de = (PDIRENT) scratch; + // PDIRENT de = (PDIRENT) scratch; FILEINFO fi; uint32_t cache = 0; uint32_t tempclus = 0; diff --git a/modules/freertos_utils/freertos_utils.c b/modules/freertos_utils/freertos_utils.c index 66fe9aef3..8eff2358d 100644 --- a/modules/freertos_utils/freertos_utils.c +++ b/modules/freertos_utils/freertos_utils.c @@ -69,7 +69,9 @@ // Local functions ///////////////////////////////////////////////////////////////////////////// +#if configGENERATE_RUN_TIME_STATS != 0 static void PerfTimerIRQ(void); +#endif ///////////////////////////////////////////////////////////////////////////// @@ -168,10 +170,10 @@ s32 FREERTOS_UTILS_RunTimeStats(void) //! \} +#if configGENERATE_RUN_TIME_STATS != 0 // this interrupt increments the performance counter static void PerfTimerIRQ(void) { ++perf_counter; } - - +#endif diff --git a/modules/midifile/mid_parser.c b/modules/midifile/mid_parser.c index fb233e20d..16c67cb0e 100644 --- a/modules/midifile/mid_parser.c +++ b/modules/midifile/mid_parser.c @@ -18,6 +18,9 @@ #include #include +#include +#include + #include "mid_parser.h" diff --git a/modules/msd/msd_scsi.c b/modules/msd/msd_scsi.c index 7b8f6094c..2710e593f 100644 --- a/modules/msd/msd_scsi.c +++ b/modules/msd/msd_scsi.c @@ -120,10 +120,10 @@ void MSD_SCSI_ReadCapacity10_Cmd(uint8_t lun) return; } - MSD_ReadCapacity10_Data[0] = (uint8_t)(MSD_Mass_Block_Count[lun] - 1 >> 24); - MSD_ReadCapacity10_Data[1] = (uint8_t)(MSD_Mass_Block_Count[lun] - 1 >> 16); - MSD_ReadCapacity10_Data[2] = (uint8_t)(MSD_Mass_Block_Count[lun] - 1 >> 8); - MSD_ReadCapacity10_Data[3] = (uint8_t)(MSD_Mass_Block_Count[lun] - 1); + MSD_ReadCapacity10_Data[0] = (uint8_t)((MSD_Mass_Block_Count[lun] - 1) >> 24); + MSD_ReadCapacity10_Data[1] = (uint8_t)((MSD_Mass_Block_Count[lun] - 1) >> 16); + MSD_ReadCapacity10_Data[2] = (uint8_t)((MSD_Mass_Block_Count[lun] - 1) >> 8); + MSD_ReadCapacity10_Data[3] = (uint8_t)((MSD_Mass_Block_Count[lun] - 1)); MSD_ReadCapacity10_Data[4] = (uint8_t)(MSD_Mass_Block_Size[lun] >> 24); MSD_ReadCapacity10_Data[5] = (uint8_t)(MSD_Mass_Block_Size[lun] >> 16); diff --git a/modules/sid/sid.c b/modules/sid/sid.c index a7ec5599c..87acd9208 100644 --- a/modules/sid/sid.c +++ b/modules/sid/sid.c @@ -18,7 +18,7 @@ #include #include "sid.h" -#include "sidemu.h" +//#include "sidemu.h" ///////////////////////////////////////////////////////////////////////////// diff --git a/modules/sid/sid.mk b/modules/sid/sid.mk index 749f04250..8663e2952 100644 --- a/modules/sid/sid.mk +++ b/modules/sid/sid.mk @@ -8,8 +8,6 @@ C_INCLUDE += -I $(MIOS32_PATH)/modules/sid # add modules to thumb sources (TODO: provide makefile option to add code to ARM sources) THUMB_SOURCE += \ $(MIOS32_PATH)/modules/sid/sid.c \ - $(MIOS32_PATH)/modules/sid/sidemu.c \ - $(MIOS32_PATH)/modules/sid/sidemu_filter.c # directories and files that should be part of the distribution (release) package