Skip to content

Commit 53286b8

Browse files
committed
Updated bms print example
1 parent bf7bd9d commit 53286b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lispBM/tests/example_print_bms_data.lisp

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323

2424
(let ((f (lambda ()
2525
(progn
26+
(define v-cells (map (lambda (c)(get-bms-val "v_cell" c)) (range 0 (- (get-bms-val "cell_num") 1))))
2627
(print (list "V Tot : " (get-bms-val "v_tot")))
27-
(print (list "V Cells: " (map (lambda (c)(get-bms-val "v_cell" c)) (range 0 (- (get-bms-val "cell_num") 1)))))
28+
(print (list "V Cells: " v-cells))
29+
(print (list "foldl : " (foldl + 0 v-cells)))
2830
(print (list "ADCs : " (map (lambda (c)(get-adc c)) (iota 1))))
29-
(print (list "foldl : " (foldl + 0 (map (lambda (c)(get-bms-val "v_cell" c)) (range 0 (- (get-bms-val "cell_num") 1))))))
3031
(print " ")
3132
(yield (/ 1000000.0 rate))
3233
(f)

0 commit comments

Comments
 (0)