Skip to content

Commit

Permalink
MBSIDV3: fixed some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
midibox committed Mar 2, 2019
1 parent 5225d4e commit 18fa0c1
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 37 deletions.
2 changes: 1 addition & 1 deletion apps/synthesizers/midibox_sid_v3/core/app.c
Expand Up @@ -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 )
Expand Down
4 changes: 4 additions & 0 deletions apps/synthesizers/midibox_sid_v3/core/app.h
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions apps/synthesizers/midibox_sid_v3/core/sid_asid.c
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions apps/synthesizers/midibox_sid_v3/core/sid_midi_d.c
Expand Up @@ -28,6 +28,7 @@

#include "sid_patch.h"
#include "sid_knob.h"
#include "sid_par.h"



Expand Down
1 change: 1 addition & 0 deletions apps/synthesizers/midibox_sid_v3/core/sid_midi_m.c
Expand Up @@ -28,6 +28,7 @@

#include "sid_patch.h"
#include "sid_knob.h"
#include "sid_par.h"
#include "sid_voice.h"


Expand Down
8 changes: 4 additions & 4 deletions apps/synthesizers/midibox_sid_v3/core/sid_par.c
Expand Up @@ -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);


/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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;

Expand Down
8 changes: 7 additions & 1 deletion apps/synthesizers/midibox_sid_v3/core/sid_se.c
Expand Up @@ -21,6 +21,8 @@
#include <sid.h>
#include <notestack.h>

#include "app.h"

#include "sid_se.h"
#include "sid_se_l.h"
#include "sid_se_b.h"
Expand Down Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/synthesizers/midibox_sid_v3/core/sid_se_b.c
Expand Up @@ -23,6 +23,7 @@
#include "sid_se.h"
#include "sid_se_b.h"
#include "sid_patch.h"
#include "sid_par.h"


/////////////////////////////////////////////////////////////////////////////
Expand All @@ -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];


///////////////////////////////////////////////////////////////////////////
Expand Down
3 changes: 0 additions & 3 deletions apps/synthesizers/midibox_sid_v3/core/sid_se_d.c
Expand Up @@ -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];


///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion apps/synthesizers/midibox_sid_v3/core/sid_se_m.c
Expand Up @@ -38,7 +38,6 @@
s32 SID_SE_M_Update(u8 sid)
{
int i;
sid_se_vars_t *vars = &sid_se_vars[sid];


///////////////////////////////////////////////////////////////////////////
Expand Down
10 changes: 5 additions & 5 deletions apps/synthesizers/midibox_sid_v3/core/sid_sysex.c
Expand Up @@ -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 ) {

Expand Down Expand Up @@ -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 ) {

Expand Down Expand Up @@ -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 ) {

Expand Down
1 change: 1 addition & 0 deletions apps/synthesizers/midibox_sid_v3/mios32/tasks.c
Expand Up @@ -20,6 +20,7 @@

#include <msd.h>

#include "app.h"
#include "tasks.h"


Expand Down
3 changes: 2 additions & 1 deletion mios32/common/mios32_enc28j60.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion mios32/common/mios32_mf.c
Expand Up @@ -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 ) {
Expand Down
4 changes: 2 additions & 2 deletions mios32/common/mios32_sdcard.c
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions modules/dosfs/dosfs.c
Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions modules/freertos_utils/freertos_utils.c
Expand Up @@ -69,7 +69,9 @@
// Local functions
/////////////////////////////////////////////////////////////////////////////

#if configGENERATE_RUN_TIME_STATS != 0
static void PerfTimerIRQ(void);
#endif


/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions modules/midifile/mid_parser.c
Expand Up @@ -18,6 +18,9 @@
#include <mios32.h>
#include <string.h>

#include <FreeRTOS.h>
#include <portmacro.h>

#include "mid_parser.h"


Expand Down
8 changes: 4 additions & 4 deletions modules/msd/msd_scsi.c
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion modules/sid/sid.c
Expand Up @@ -18,7 +18,7 @@
#include <mios32.h>

#include "sid.h"
#include "sidemu.h"
//#include "sidemu.h"


/////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 0 additions & 2 deletions modules/sid/sid.mk
Expand Up @@ -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
Expand Down

0 comments on commit 18fa0c1

Please sign in to comment.