Commit 3f0dbe67 authored by Mart Lubbers's avatar Mart Lubbers
Browse files

actually calculate hash for taskprep

parent 66889963
Pipeline #53989 passed with stage
in 2 minutes and 2 seconds
......@@ -164,7 +164,7 @@ where
# td & status = MTNeedsInit
# bytes = join ", " [toString c\\c<-gCSerialise{|*|} td []]
= ptwo ns ts
[ concat5 "#define PRELOADED_HASH" (toString n) " " (toString $ gHash{|*|} bytes) "ll"
[ concat5 "#define PRELOADED_HASH" (toString n) " " (toString $ mtaskmetatohash td) "ll"
, concat5 "static const uint8_t preloaded_task" (toString n) "[] PROGMEM = {" bytes "};"
: c]
footer =
......@@ -198,6 +198,9 @@ where
, ""
: s]
mtaskmetatohash :: MTaskMeta -> Int
mtaskmetatohash mm = gHash{|*|} $ gCSerialise{|*|} mm []
preloadTask :: (Main (BCInterpret (TaskValue u))) -> Task String | type u
preloadTask a = preloadTaskWithOptions zero a
......@@ -246,7 +249,7 @@ liftmTaskWithOptions opts task (MTDevice dev sdsupdates channels)
//Add task to sdsupdates map
upd (put sid []) sdsupdates
//Send the prep
>-| sendMessage (MTTTaskPrep {taskid=sid, hash=0}) channels
>-| sendMessage (MTTTaskPrep {taskid=sid, hash=mtaskmetatohash msg}) channels
//Wait for the prepack
>-| watch taskView
>>* [OnValue $ ifValue taskAccepted \t->case t of
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment