mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Add get_random_32()
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user