Subversion Repositories svn.mios32

Compare Revisions

Ignore whitespace Rev 2588 → Rev 2589

/trunk/apps/controllers/midibox_ng_v1/CHANGELOG.txt
1,5 → 1,22
$Id$
 
MIDIbox NG V1.037
~~~~~~~~~~~~~~~~~
 
o .NGR: the "send SysEx" command can now also parse ASCII strings.
This is a comfortable way to send terminal commands to other MIDIboxes.
E.g. assumed that a MIDIbox SEQ is connected to MIDI OUT1, you could send:
send sysex OUT1 0xf0 0x00 0x00 0x7e 0x32 0x00 0x0d 0x00 "reset" 0x0a 0xf7
to reset the MIDIbox, or:
send sysex OUT1 0xf0 0x00 0x00 0x7e 0x32 0x00 0x0d 0x00 "new sesn42" 0x0a 0xf7
to create a new session, or:
send sysex OUT1 0xf0 0x00 0x00 0x7e 0x32 0x00 0x0d 0x00 "lcd Hello!" 0x0a 0xf7
to display a message on screen.
 
Transformation of values to ASCII isn't supported yet.
If it's a single digit, you could try ..."lcd Value: " [0x30 + ^value]
 
 
MIDIbox NG V1.036
~~~~~~~~~~~~~~~~~
 
/trunk/apps/controllers/midibox_ng_v1/src/mbng_file_r.c
663,7 → 663,7
case '%': math_token = TOKEN_MATH_REMAIN; break;
case '&': math_token = TOKEN_MATH_AND; break;
case '|': math_token = TOKEN_MATH_OR; break;
case '^': math_token = TOKEN_MATH_XOR; break;
case '^': if( i != 0 ) math_token = TOKEN_MATH_XOR; break; // support ^value etc.
}
 
if( math_token != TOKEN_NOP ) {
688,7 → 688,7
}
}
 
//DEBUG_MSG("Calc: %s %c %s\n", lOperand, operator, rOperand);
//DEBUG_MSG("Calc: %s 0x%02x %s\n", lOperand, math_token, rOperand);
 
// get left side value (recursively)
s32 lValue = parseValue(line, command, trim(lOperand), tokenize_req);
725,7 → 725,6
return -1000000000;
}
 
 
if( value_str[0] == '^' ) {
if( strcasecmp((char *)&value_str[1], "SECTION") == 0 ) {
#if NGR_TOKENIZED
1221,10 → 1220,10
#endif
return -1;
} else {
*stream_pos = 0xff; // meta indicator
++stream_pos;
*(stream_pos++) = 0xff; // meta indicator
++stream_size;
*stream_pos = (u8)sysex_var;
*(stream_pos++) = (u8)sysex_var;
++stream_size;
}
#if NGR_TOKENIZED
if( tokenize_req ) {
1235,6 → 1234,36
return -1;
}
#endif
} if( *stream_str == '"' ) {
// parse string
// consider that it has been tokenized disable break and parse until terminating quote
{
size_t len = strlen(stream_str);
if( &stream_str[len] != brkt_local ) {
stream_str[len] = ' ';
}
}
 
while( *(++stream_str) != '"' && *stream_str != 0 ) {
// escaped character (only way to send a '"' or '\' itself)
if( *stream_str == '\\' ) {
if( *(++stream_str) == 0 )
break;
}
 
*(stream_pos++) = *stream_str;
++stream_size;
}
 
if( *stream_str == '\"' ) {
++stream_str;
}
 
while( *stream_str == ' ' || *stream_str == '\t' ) {
++stream_str;
}
 
brkt_local = stream_str;
} else {
int value;
if( (value=parseValue(line, command, stream_str, tokenize_req)) < 0 || value > 0xff ) {
1243,11 → 1272,10
#endif
return -1;
} else {
*stream_pos = (u8)value;
*(stream_pos++) = (u8)value;
++stream_size;
}
}
++stream_pos;
++stream_size;
}
 
if( !stream_size ) {
/trunk/apps/controllers/midibox_ng_v1/src/terminal.c
47,7 → 47,8
//! Local defines
/////////////////////////////////////////////////////////////////////////////
 
#define STRING_MAX 100 // recommended size for file transfers via FILE_BrowserHandler()
//#define STRING_MAX 100 // recommended size for file transfers via FILE_BrowserHandler()
#define STRING_MAX 255 // for larger terminal commands
 
 
/////////////////////////////////////////////////////////////////////////////