Skip to content

Commit

Permalink
get free addresses bug
Browse files Browse the repository at this point in the history
  • Loading branch information
limpkin committed Apr 9, 2015
1 parent 724da98 commit f4e58f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Binary file modified source_code/Mooltipass.atsuo
Binary file not shown.
2 changes: 1 addition & 1 deletion source_code/src/USB/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ From Mooltipass: One CPZ CTR LUT entry packet
-----------------------------
From plugin/app: 2 bytes payload indicating the address to start scanning from (in doubt, set 0x00 0x00).

From Mooltipass: 0x00 if failure, 32 slot addresses max otherwise (see payload length field)
From Mooltipass: 0x00 if failure, 31 slot addresses max otherwise (see payload length field)

0xD1: Get Starting data parent Address
--------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions source_code/src/USB/usb_cmd_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,11 +812,11 @@ void usbProcessIncoming(uint8_t caller_id)
{
// Memory management mode check implemented before the switch
uint16_t* temp_addr_ptr = (uint16_t*)msg->body.data;
uint16_t nodeAddresses[32];
uint16_t nodeAddresses[31];
uint8_t nodesFound;

// Call the dedicated function
nodesFound = findFreeNodes(32, nodeAddresses, pageNumberFromAddress(*temp_addr_ptr), nodeNumberFromAddress(*temp_addr_ptr));
nodesFound = findFreeNodes(31, nodeAddresses, pageNumberFromAddress(*temp_addr_ptr), nodeNumberFromAddress(*temp_addr_ptr));

// Send addresses
usbSendMessage(CMD_GET_FREE_SLOTS_ADDR, nodesFound*2, (uint8_t*)nodeAddresses);
Expand Down

0 comments on commit f4e58f4

Please sign in to comment.