1
0
mirror of https://github.com/xtacocorex/CHIP_IO synced 2025-07-20 04:43:21 +00:00

fixing issues with the code to determine if the computer is a chip/chip pro for #32

This commit is contained in:
Robert Wolterman
2017-02-26 00:50:54 +00:00
parent 121ad398e4
commit c3ead5d395

View File

@ -222,19 +222,25 @@ int get_xio_base(void)
} /* get_xio_base */
#define RAMDETERMINER 380.0
#define MEGABYTE 1024.0*1024.0
int is_this_chippro(void)
{
int is_pro = 0;
struct sysinfo si;
sysinfo (&si);
const double megabyte = 1024 * 1024;
if ((si.totalram/MEGABYTE) > RAMDETERMINER) {
if (DEBUG)
printf(" ** is_this_chippro: total system ram: %5.1f mb\n", si.totalram / megabyte);
if ((si.totalram/megabyte) > RAMDETERMINER) {
is_pro = 0;
if (DEBUG)
printf(" ** is_this_chippro: we are a chip\n");
} else {
is_pro = 1;
if (DEBUG)
printf(" ** is_this_chippro: we are a chip pro\n");
}
return is_pro;