mirror of
https://github.com/schoebel/mars
synced 2025-03-01 19:10:48 +00:00
remove percent display (should be done by userspace)
This commit is contained in:
parent
c8e7d8b59d
commit
f3068dec34
1
mars.h
1
mars.h
@ -166,7 +166,6 @@ struct mars_info {
|
|||||||
const char *brick_path; \
|
const char *brick_path; \
|
||||||
struct mars_global *global; \
|
struct mars_global *global; \
|
||||||
void (*show_status)(struct mars_brick *brick, bool shutdown); \
|
void (*show_status)(struct mars_brick *brick, bool shutdown); \
|
||||||
int status_level; \
|
|
||||||
|
|
||||||
struct mars_brick {
|
struct mars_brick {
|
||||||
MARS_BRICK(mars);
|
MARS_BRICK(mars);
|
||||||
|
@ -453,16 +453,6 @@ void _show_brick_status(struct mars_brick *test, bool shutdown)
|
|||||||
|
|
||||||
status = mars_symlink(src, dst, NULL, 0);
|
status = mars_symlink(src, dst, NULL, 0);
|
||||||
MARS_DBG("status symlink '%s' -> '%s' status = %d\n", dst, src, status);
|
MARS_DBG("status symlink '%s' -> '%s' status = %d\n", dst, src, status);
|
||||||
if (test->status_level > 1) {
|
|
||||||
char perc[8];
|
|
||||||
char *dst2 = path_make("%s.percent", dst);
|
|
||||||
if (likely(dst2)) {
|
|
||||||
snprintf(perc, sizeof(perc), "%d", test->power.percent_done);
|
|
||||||
status = mars_symlink(perc, dst2, NULL, 0);
|
|
||||||
MARS_DBG("percent symlink '%s' -> '%s' status = %d\n", dst2, src, status);
|
|
||||||
brick_string_free(dst2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
brick_string_free(dst);
|
brick_string_free(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,7 +466,7 @@ void _show_status_all(struct mars_global *global)
|
|||||||
struct mars_brick *test;
|
struct mars_brick *test;
|
||||||
|
|
||||||
test = container_of(tmp, struct mars_brick, global_brick_link);
|
test = container_of(tmp, struct mars_brick, global_brick_link);
|
||||||
if (test->status_level <= 0)
|
if (!test->show_status)
|
||||||
continue;
|
continue;
|
||||||
_show_brick_status(test, false);
|
_show_brick_status(test, false);
|
||||||
}
|
}
|
||||||
@ -570,7 +560,6 @@ int __make_copy(
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
copy->show_status = _show_brick_status;
|
copy->show_status = _show_brick_status;
|
||||||
copy->status_level = 2;
|
|
||||||
_copy = (void*)copy;
|
_copy = (void*)copy;
|
||||||
if (__copy)
|
if (__copy)
|
||||||
*__copy = _copy;
|
*__copy = _copy;
|
||||||
@ -2158,7 +2147,6 @@ int make_dev(void *buf, struct mars_dent *dent)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
dev_brick->show_status = _show_brick_status;
|
dev_brick->show_status = _show_brick_status;
|
||||||
dev_brick->status_level = 1;
|
|
||||||
_dev_brick = (void*)dev_brick;
|
_dev_brick = (void*)dev_brick;
|
||||||
#if 0
|
#if 0
|
||||||
if (_dev_brick->has_closed) {
|
if (_dev_brick->has_closed) {
|
||||||
@ -2875,7 +2863,7 @@ void _show_one(struct mars_brick *test, int *brick_count)
|
|||||||
if (*brick_count) {
|
if (*brick_count) {
|
||||||
MARS_STAT("---------\n");
|
MARS_STAT("---------\n");
|
||||||
}
|
}
|
||||||
MARS_STAT("BRICK type = %s path = '%s' name = '%s' level = %d button = %d off = %d on = %d\n", SAFE_STR(test->type->type_name), SAFE_STR(test->brick_path), SAFE_STR(test->brick_name), test->status_level, test->power.button, test->power.led_off, test->power.led_on);
|
MARS_STAT("BRICK type = %s path = '%s' name = '%s' button = %d off = %d on = %d\n", SAFE_STR(test->type->type_name), SAFE_STR(test->brick_path), SAFE_STR(test->brick_name), test->power.button, test->power.led_off, test->power.led_on);
|
||||||
(*brick_count)++;
|
(*brick_count)++;
|
||||||
if (test->ops && test->ops->brick_statistics) {
|
if (test->ops && test->ops->brick_statistics) {
|
||||||
char *info = test->ops->brick_statistics(test, 0);
|
char *info = test->ops->brick_statistics(test, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user