Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 5:af9b6ec6b9b5
- Parent:
- 4:558b29109618
--- a/main.cpp Sun Jun 01 11:48:26 2014 +0000
+++ b/main.cpp Sun Jun 01 12:06:42 2014 +0000
@@ -86,7 +86,8 @@
int num_packets = 0;
FILE *fp = fopen("/local/packet.txt", "w");
- for(; num_packets < PACKET_COUNT; num_packets++){
+ for(num_packets=0; num_packets < PACKET_COUNT; num_packets++){
+
a = (char *) malloc(sizeof(char) * 21);
if(a==NULL){
@@ -99,9 +100,9 @@
fclose(fp);
return 1;
}
- for(idx=0; idx < 20; idx++){
+ for(idx=0; idx < 19; idx++){
a[idx] = char(pc.getc());
-
+ if(num_packets==1)myled3 = 1;
fprintf(fp,"%c",a[idx]);
if(idx == 1)
fprintf(fp,".");
@@ -113,16 +114,15 @@
fprintf(fp,".");
if(idx == 18)
fprintf(fp,".");
- if(idx == 19)
- a[idx] = 0;
}
+ a[19]=0;
idx = 0;
fprintf(fp,"\n");
- // buffer2.push(a);
+
buffer4.put((char**)&a[0]);
-
+
osEvent evt = buffer4.get();
if (evt.status != osEventMessage) {
printf("Furnace: queue->get() returned %02x status\n\r", evt.status);