Skip to content

Commit

Permalink
Ensure doubles work on nRF52, and fix handling of unary expression (t…
Browse files Browse the repository at this point in the history
…yping was wrong)
  • Loading branch information
gfwilliams committed Jul 20, 2022
1 parent de7f8da commit d5534b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compile.js
Expand Up @@ -84,8 +84,9 @@ var nodeHandlers = {
operator : node.operator,
left : { type : "Literal", value : 0, varType : "int" },
right : node.argument,
varType : node.argument.varType
};
return handleAsJsVar(expr);
return handle(expr, node.argument.varType);
} else {
throw new Error("Only '!', '~', '-', and '+' are implemented as a unary expression");
}
Expand Down Expand Up @@ -444,7 +445,7 @@ function gcc(code, options, callback) {
console.warn('Unknown CPU! ' + options.boardInfo.cpu);
}
if (options.boardInfo.nrf52) // on nRF52 use hardware floating point unit
cflags += "-mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wdouble-promotion -Wfloat-conversion ";
cflags += "-mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wdouble-promotion -Wfloat-conversion ";
else
cflags += "-mfloat-abi=soft ";
cflags += "-nostdinc -nostdlib ";
Expand Down

0 comments on commit d5534b6

Please sign in to comment.