Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 260 → Rev 261

/PIC Stuff/Cerebot_32MX7_LED_Cube/CUBE.c
848,13 → 848,13
 
void Cube_Ethernet_Frame_In(void) {
uint8_t i,j,k;
uint8_t buffer[2048];
uint8_t buffer[2048] = {0};
uint16_t length;
uint16_t index = 1;
 
// Read and process the ethernet packet
if (ETH_Read_Packet(buffer, &length)) {
// Check the first byte to determine what to do
if (!ETH_Read_Packet(buffer, &length)) {
// Check the opcode (first byte) to determine what to do
if (buffer[0] == 0x1) {
Reset_Board(BOARD_MODE_ETHERNET);
}
862,6 → 862,9
Reset_Board(BOARD_MODE_IDLE);
}
if (buffer[0] == 0xA) {
Cube_Clear();
}
if (buffer[0] == 0xB) {
ClearWDT();
// Update the cube
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
868,7 → 871,7
for (j = 0; j < CUBE_COLUMN_COUNT; j++) {
for (k = 0; k < CUBE_ROW_COUNT; k++) {
Cube_Set_Pixel(i, k, j, buffer[index], buffer[index+1], buffer[index+2]);
index += 3;
index = index + 3;
}
}
}