Add get_random_32()

This commit is contained in:
logicog
2025-12-01 18:26:46 +01:00
parent 73a81ec031
commit 70c14fb23e
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -104,5 +104,6 @@ uint16_t strtox(register __xdata uint8_t *dst, register __code const char *s);
void tcpip_output(void);
void print_string_x(__xdata char *p);
uint8_t read_flash(uint8_t bank, __code uint8_t *addr);
void get_random_32(void);
#endif
+12
View File
@@ -402,6 +402,18 @@ void sfr_set_zero(void) {
}
}
/*
* Create 32 random number in sfr_data
*/
void get_random_32(void)
{
// In order to get a new random numner, this bit has to be set each time!
reg_bit_set(RTL837X_RLDP_RLPP, RLDP_RND_EN);
reg_read_m(RTL837X_RAND_NUM0);
}
/*
* Transfer Network Interface RX data from the ASIC to the 8051 XMEM
* data will be stored in the rx_header structure