From 293bfe65ffa7faa487e82f129c515fec167ce8da Mon Sep 17 00:00:00 2001 From: ruancong Date: Sun, 16 Apr 2023 11:38:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=86=97=E4=BD=99=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- solutions/eduk1_demo/k1_apps/compass/compass.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/solutions/eduk1_demo/k1_apps/compass/compass.c b/solutions/eduk1_demo/k1_apps/compass/compass.c index 9700f966b3..ed162fc49d 100644 --- a/solutions/eduk1_demo/k1_apps/compass/compass.c +++ b/solutions/eduk1_demo/k1_apps/compass/compass.c @@ -93,28 +93,28 @@ void format_compass_str(char *number_str, heading = (heading % 360 < 0) ? (heading % 360 + 360) : (heading % 360); sprintf(number_str, "%3d", heading); if ((heading > 0 && heading <= 23) || (heading > 337 && heading <= 360)) { - sprintf(code_str, " N", heading); + sprintf(code_str, " N"); *arror_len = 16; } else if (heading > 292 && heading <= 337) { - sprintf(code_str, "WN", heading); + sprintf(code_str, "WN"); *arror_len = 20; } else if (heading > 246 && heading <= 292) { - sprintf(code_str, " W", heading); + sprintf(code_str, " W"); *arror_len = 16; } else if (heading > 202 && heading <= 246) { - sprintf(code_str, "WS", heading); + sprintf(code_str, "WS"); *arror_len = 20; } else if (heading > 158 && heading <= 202) { - sprintf(code_str, " S", heading); + sprintf(code_str, " S"); *arror_len = 16; } else if (heading > 112 && heading <= 158) { - sprintf(code_str, "ES", heading); + sprintf(code_str, "ES"); *arror_len = 20; } else if (heading > 67 && heading <= 112) { - sprintf(code_str, " E", heading); + sprintf(code_str, " E"); *arror_len = 16; } else if (heading > 23 && heading <= 67) { - sprintf(code_str, "EN", heading); + sprintf(code_str, "EN"); *arror_len = 20; } }