@@ -407,60 +407,76 @@ void deeplyembedded_credits()
407
407
}
408
408
409
409
410
- void testdate ()
410
+ void testdate (int standalone )
411
411
{
412
412
time_t rawtime ;
413
413
time_t curtime ;
414
414
uint8_t timebuff [TIMESIZE ];
415
415
curtime = time (NULL );
416
416
time (& rawtime );
417
- strftime (timebuff ,80 ,"%Y-%m-%d %H:%M:%S" ,localtime (& rawtime ));
418
- sprintf (buf ,"%s" ,timebuff );
419
- print_strln (buf );
417
+ if (standalone )
418
+ {
419
+ strftime (timebuff ,80 ,"%Y-%m-%d" ,localtime (& rawtime ));
420
+ sprintf (buf ,"%s" ,timebuff );
421
+ setCursor ((127 - strlen (buf )* 11 )/2 - 2 ,0 );
422
+ print_strln (buf );
423
+ strftime (timebuff ,80 ,"%H:%M:%S" ,localtime (& rawtime ));
424
+ sprintf (buf ,"%s" ,timebuff );
425
+ setCursor ((127 - strlen (buf )* 11 )/2 ,16 );
426
+ print_strln (buf );
427
+ }
428
+ else {
429
+ strftime (timebuff ,80 ,"%Y-%m-%d %H:%M:%S" ,localtime (& rawtime ));
430
+ sprintf (buf ,"%s" ,timebuff );
431
+ print_strln (buf );
432
+ }
420
433
421
434
}
422
435
423
436
424
- void testlanip ()
437
+ void testlanip (int standalone )
425
438
{
426
439
if ((fp = popen (IPPATH ,"r" ))!= NULL )
427
440
{
428
441
fscanf (fp ,"%s" ,content_buff );
429
442
fclose (fp );
430
443
//ipbuff[strlen(ipbuff)-1]=32;
431
- sprintf (buf ,"IP:%s" ,content_buff );
444
+ if (standalone ) {sprintf (buf ,"%s" ,content_buff ); setTextSize (1 ); setCursor ((127 - strlen (buf )* 6 )/2 , 12 );}
445
+ else sprintf (buf ,"IP:%s" ,content_buff );
432
446
print_strln (buf );
433
447
}
434
448
435
449
}
436
450
437
451
438
- void testcputemp ()
452
+ void testcputemp (int standalone )
439
453
{
440
454
if ((fp = fopen (TEMPPATH ,"r" ))!= NULL )
441
455
{
442
456
fgets (content_buff ,TEMPSIZE ,fp );
443
457
fclose (fp );
444
- sprintf (buf ,"CPU TEMP:%.2f C" ,atoi (content_buff )/100.0 );
458
+ if (standalone ) {sprintf (buf , "%.2f C" ,atoi (content_buff )/100.0 ); setCursor ((127 - strlen (buf )* 11 )/2 , 8 );}
459
+ else sprintf (buf ,"CPU TEMP:%.2f C" ,atoi (content_buff )/100.0 );
445
460
print_strln (buf );
446
461
}
447
462
448
463
}
449
464
450
465
451
- void testcpufreq ()
466
+ void testcpufreq (int standalone )
452
467
{
453
468
if ((fp = popen (FREQPATH ,"r" )) != NULL )
454
469
{
455
470
fgets (content_buff ,FREQSIZE ,fp );
456
471
fclose (fp );
457
- sprintf (buf ,"CPU FREQ:%d Mhz " ,atoi (content_buff )/1000 );
472
+ if (standalone ) {sprintf (buf ,"%d Mhz" ,atoi (content_buff )/1000 ); setCursor ((127 - strlen (buf )* 11 )/2 , 8 );}
473
+ else sprintf (buf ,"CPU FREQ:%d Mhz" ,atoi (content_buff )/1000 );
458
474
print_strln (buf );
459
475
}
460
476
461
477
}
462
478
463
- void testnetspeed ()
479
+ void testnetspeed (int standalone )
464
480
{
465
481
if ((fp = popen (NETPATH ,"r" )) != NULL )
466
482
{
0 commit comments