/* * Show/Sets the mass of the vehicle */ static int cmd_dyno_mass(int argc, char **argv) { if (argc > 1) dyno_set_mass(htoi(argv[1])); else printf("mass: %d kg\n", dyno_get_mass()); return (0); }
/* * Show/Sets the mass of the vehicle */ static int cmd_dyno_mass(int argc, char **argv) { int mass=0; if (argc > 1) mass=htoi(argv[1]); if (mass > 0) dyno_set_mass(mass); else printf("mass: %d kg\n", dyno_get_mass()); return 0; }