30 bool fTemperatureInFahrenheit = 0;
39 static void _int2str( u8* ptr, int_t X, len_t digit,
bool flagunsigned,
bool fillwithzero );
58 NODEBUG
void vbattoa( u8* ptr, u16 X )
64 c = ( ( X - r ) / 1000 );
72 c = ( ( X - r ) / 100 );
77 c = ( ( X - r ) / 10 );
104 NODEBUG
static void _int2str( u8* ptr, int_t X, len_t digit,
bool flagunsigned,
bool fillwithzero )
113 for ( i = 1; i < digit; i++ )
118 if ( !flagunsigned && ( X < 0 ) )
128 for ( i = 0; i < digit; i++, DIG /= 10 )
133 if ( fillwithzero || fFirst || c || ( i == ( digit - 1 ) ) )
135 if ( ( fFirst == 0 ) && !flagunsigned )
137 *ptr++ = fNeg ?
'-' :
' ';
140 *ptr++ = ( c % 10 ) +
'0';
174 fTemperatureInFahrenheit = mode;
200 _int2str( ptr, X, digit, 1, fillwithzero );
224 _int2str( ptr, X, digit, 0, fillwithzero );
260 return STR_OSVERSION;
286 #if ( MEMS_POINTER && MEMS_SPEC_MNGT ) // Not necessary if no MEMS menu handling
288 pMEMS_Handler = pHDL;
292 if ( Ix < COUNTOF( SchHandler ) )
293 SchHandler[Ix] = pHDL;
318 #if (MEMS_POINTER && MEMS_SPEC_MNGT) // Not necessary if no MEMS menu handling
320 return pMEMS_Handler;
324 if ( Ix < COUNTOF( SchHandler ) )
325 return SchHandler[Ix];
347 return fIsStandAlone;
368 return POWER_ReadStatus( );
389 #define WRITE_VALUE(type,val) {value = (val); *(type*)(localbuf+ofs) = value;ofs+=sizeof(type);}
392 char localbuf[ 2 + 12 + 40 + 1];
393 unsigned size, ofs, value;
396 unsigned width = PHYS_SCREEN_WIDTH;
397 unsigned height = PHYS_SCREEN_HEIGHT;
402 width = PHYS_SCREEN_HEIGHT;
403 height = PHYS_SCREEN_WIDTH;
410 if ( !filename || !*filename )
419 if ( StartMBR != FR_OK )
426 if ( FS_GetVolumeInfo( 0, StartMBR, &volume_info ) )
443 size = 2 + 12 + 40 + width * height * 3;
446 WRITE_VALUE(
unsigned, size );
447 WRITE_VALUE(
unsigned, 0 );
448 WRITE_VALUE(
unsigned, 2 + 12 + 40 );
451 WRITE_VALUE(
unsigned, 40 );
452 WRITE_VALUE(
unsigned, width );
453 WRITE_VALUE(
unsigned, height );
454 WRITE_VALUE(
short unsigned, 1 );
455 WRITE_VALUE(
short unsigned, 24 );
456 WRITE_VALUE(
unsigned, 0 );
457 WRITE_VALUE(
unsigned, ( 3 * width * height ) );
458 WRITE_VALUE(
unsigned, 0 );
459 WRITE_VALUE(
unsigned, 0 );
460 WRITE_VALUE(
unsigned, 0 );
461 WRITE_VALUE(
unsigned, 0 );
463 retval = FS_WriteFile( &file_capture, localbuf, &successcount, 2 + 12 + 40 );
468 for ( y = 0 ; ( y < height ) && ( retval == 0 ) ; y++ )
470 for ( x = 0 ; ( x < width ) && ( retval == 0 ) ; x++ )
478 red = ( pix & 0xf8 );
479 green = ( ( pix << 5 ) & 0xE0 ) | ( ( pix >> 11 ) & 0x1C );
480 blue = ( ( pix >> 5 ) & 0xF8 );
482 localbuf[0 + index_wr * 3] = blue;
483 localbuf[1 + index_wr * 3] = green;
484 localbuf[2 + index_wr * 3] = red;
485 if ( ++index_wr == 4 )
487 retval = FS_WriteFile( &file_capture, localbuf, &successcount, 3 * 4 );
488 size += successcount;
493 FS_Close( &file_capture );
500 #endif // if SDCARD_AVAIL
524 SchHandlerDivider[IDx] = divider;
546 return SchHandlerDivider[IDx];